Solved

instance targeting syntax error

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Can't play a movie website which used to be playable 4 635
How to convert pdf file to html file 8 394
File drag and drop 6 142
embedding a media live encoder stream 3 132
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…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

773 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