Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Actionscript / May 2005



Tip: Looking for answers? Try searching our database.

Code execution order

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ufitzi - 31 May 2005 15:42 GMT
on the uppermost layer of my main timeline I have a line of code (on the frame)
which updates an instance of an object.
on a lower layer (the content of the movie) I have a ScrollPane with the
content member pointing to a MC in the library.
The MC has linkage settings so that it uses a custom class.
In the constructor for this class I request the information from my main
timeline instance that was updated with the frame code, as mentioned above.

Of course you already know my problem, and that is that the constructor code
is executiong first, regardless of load order settings for my main SWF
(TOP-DOWN vs. BOTTOM-UP).

Please, if you have any information pertinent to this problem, do not hold
back!
It is of dire consequence that I.......

ok, just kidding.
just respond if you feel sorry for me!

Thanks Folks!!
bh
krl - 31 May 2005 17:04 GMT
I don't know code execution presidence, but try sticking a trace inside each code snippet to see what pops up sequentially in the output window.
ufitzi - 31 May 2005 17:10 GMT
Yes, I've done that.
It verified that in both cases (top-down,bottom-up), the constructor is being
called first.
My temporary solution is to add an extra frame, and let the code run on frame
n, then advance to frame n+1 and place the MC on the stage.
I would really like to know how to control the situation better, though.

Any additional thought s would be great.
Thanks for the response, krl!!!

bh
krl - 31 May 2005 17:53 GMT
:) I read that wrong.

Instead of requesting the information in your constructor make an additional
method that updates your class and call this method after you update the
information in your timeline.

Tell me if it works.
ufitzi - 31 May 2005 19:08 GMT
I tried to set it up in that fashion, by using the onClipEvent(load) method, as
well as calling the update method from the timeline, but I can't get it to
occur AFTER mymain update method.
The advance a frame solution works, though.
I've found w/ Flash you have to modify your logic slightly, to play its' game
so to speak.
FOr example, I've given up attempting while loops, and instead set up a
timeline controlled looping procedure.
It seems the more you seperate your code using frames, the better Flash is at
handling it,
I think it is a remnant of the fact that Flash was a graphical application
first, before it was developed into an object oriented programming language.
Simple things often end up causing undo headaches.
Sometimes it's best to just give in and use a trick you know will work.

oh well!
Thanks again
bh
krl - 31 May 2005 20:00 GMT
Yeah, glad you got it to work the way you did. Maybe one day you'll be doing something else and you'll get it to work how we're thinking.

Take care and God bless.
krl
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.