Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

instance targeting syntax error

Posted on 2006-12-01
6
Medium Priority
?
178 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
4 Comments
 
LVL 11

Accepted Solution

by:
ch2 earned 1000 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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 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…
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…
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses
Course of the Month8 days, 8 hours left to enroll

876 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