PDA

View Full Version : all I wanna do


forcemorph
05-04-2007, 04:04 PM
All I want to do is start a netconnection and reflect the status in a text field on the stage... I've done this in 2.0 and it's easy. Now with 3.0, using classes and whatnot, it seems impossible. I successfully wrote a class that connects, it's just that I can't update the dynamic textfield on the stage because the class cannot access it. I've tried looking through the livedocs on how items on the stage work now, but it only half makes sense to me. Can I even reference back to items already on the stage, or do I have to dynamically create the textfield in the class? I tried the latter method, but again I couldn't reference back to the stage to add the new child.

Any help?

Also, it sucks that all of the actionscript 3.0 books (except the cookbook) aren't coming out until the end of the summer...

Dazzer
05-05-2007, 01:48 AM
To access objects on the stage in the actionscript, simply give the object a label, and declare it in your actionscript file


public var myTextField:TextField;


make sure you import java.text.*;

hope that helps

TheCanadian
05-05-2007, 02:13 AM
I hope you mean flash.text.*; :P

Dazzer
05-05-2007, 02:48 AM
GAH

don't blame me. I'm doing java in uni :S
- sigh -

sorry! :D

- another crappy language to purge out of my system -