OZONE Asylum
Forums
Multimedia/Animation
erm... attachMovie in class constructors?
This page's ID:
11466
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
(sigh) I guess it's something 2004-related after all. I should probably just code to MX practices until 2004 has been out long enough to have a reasonable penetration -- it'll make it more likely that my problems can be resolved with simple Googling. The event handler object gets created in a class constructor, and the function tries to access a variable that exists within the scope of the class. It doesn't make a difference whether I declare the variable as private, public, or default. I'll post the problem on the forum of one of the bigger Flash sites, where there's sure to be a higher Flash guru density, and get back here with the solution. You've been very helpful already, Steve, I don't want to researching new things just for me. Example code, just in case you notice something: [code] class TheClass { [i]/* constructor */[/i] public function TheClass() { handler.onKeyDown = function() { trace(test); } Key.addListener(handler); } [i]/* variables */[/i] public var test = 12; private var handler = new Object(); } [/code] Then of course it's invoked with a little "thing = new TheClass()" statement in the main program logic. [url=http://faq.ozoneasylum.com/1250]Cell 1250[/url] :: [url=http://www.alanmacdougall.com]alanmacdougall.com[/url] :: [url=http://www.gurusnetwork.com/tutorials/illustrator/index.html]Illustrator tips[/url]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »