Solved

instance targeting syntax error

Posted on 2006-12-01
6
176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 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 last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
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 what frame rate is, how to control it and what effect it has on the video.
Suggested Courses

632 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