Solved

instance targeting syntax error

Posted on 2006-12-01
6
171 Views
Last Modified: 2010-04-03
I'm designing a movie that will read some xml file info and build a bar chart from the data within. Basically my actionscript code works up to the point of me animating the bar chart bars.

Basically i've written a function that takes the relevant info (stored in an array) and then tells the bar (movie clip) elements to tween the y-axis movement. In principle this should work, however I keep getting a syntax error as soon as I include the statements below:

function buildBar(myArray, myloop) {
      switch (myloop) {
      case 0 :
            //day 1 bar
            //set max bar limit
            var barStart = _root.day1.90bar._y;
            var bar90max = myArray["opl90"];
            var bar123max = myArray["oml123"];
            var bar124max = myArray["oml124"];
            moveForward(this.day1.90bar,barStart,bar90max);//90bar,barStart,bar90max);
            break;
      }
}
---------THE ERROR MESSAGE --------
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 18: Syntax error.
                 var barStart = _root.day1.90bar._y;

The script always hangs on where I target the instance i.e. _root.day1.90bar blah blah. As soon as I take out any reference to an instance the code compiles fine.

Any ideas on what could be going wrong here?
0
Comment
Question by:2nde
  • 2
  • 2
6 Comments
 
LVL 11

Accepted Solution

by:
ch2 earned 250 total points
ID: 18053053
You cannot use numbers at the begining in actionscript.

90bar should look like bar90
0
 

Author Comment

by:2nde
ID: 18053608
....? if that works, i'm gonna fling myself off the nearest building ...
0
 

Author Comment

by:2nde
ID: 18053642
Dear God....... thanks a bunch mate, u just saved anotha soul....
0
 
LVL 11

Expert Comment

by:ch2
ID: 18053784
You are welcome :)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now