Solved

instance targeting syntax error

Posted on 2006-12-01
6
174 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

821 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