Newgrounds.com — Everything, By Everyone.

Checking login status…

USERNAME:

PASSWORD:

Logging in…

Logged in as:
.
Logging out…
Inbox My Account Log Out


Forum Topic: [AS3] Variable paths?

(33 views • 2 replies)

This topic is 1 page long.

<< < > >>
None

iv00w

Reply To Post Reply & Quote

Posted at: 6/16/08 03:55 PM

iv00w EVIL LEVEL 08

Sign-Up: 04/24/05

Posts: 371

Hey

In my main stage (_root ?) I'm handling a few variables. Now I have a movieclip with the following code:

varText.text = root.varNumber;

varNumber is properly defined and given a value in the main stage and varText is a text field inside my movieclip, which has the instance name of 'panel1'.

Anyway, I keep getting the error:
1119: Access of possibly undefined property varNumber through a reference with static type flash.display:DisplayObject.

What is the proper path to it? The layout is:
Stage -> Movieclip

Thanks in advance.


None

lautan

Reply To Post Reply & Quote

Posted at: 6/16/08 04:10 PM

lautan LIGHT LEVEL 12

Sign-Up: 03/18/07

Posts: 279

Pretty sure its

vartext.text = MovieClip(root).panel1

I haven't use text fields yet so it might be wrong.


None

iv00w

Reply To Post Reply & Quote

Posted at: 6/16/08 04:18 PM

iv00w EVIL LEVEL 08

Sign-Up: 04/24/05

Posts: 371

It works perfectly now, thanks a lot!


All times are Eastern Daylight Time (GMT -4) | Current Time: 05:11 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!