Stuff I am building:


Ted Patrick - Events & Community @ Adobe Systems


Note: This is the personal blog of Ted Patrick. The opinions and statements voiced here are my own.



Central _root & _level0 workaround...

DIGG IT!     0 Comments Published Thursday, December 18, 2003 at 5:28 AM .

Within Central apps you can't use _root and _level0 in your code as they refer to different things within the Central Player. Here is a simple workaround that solves many of problems your will encounter working without root.\0

1. Create a _global object for your apps variables, props, methods, classes:

_global.icon04 = {}

2. Create a property called "root" within the object with a reference to the main timeline:

_global.icon04.root = this

*I am not sure if a common _global is accessible from pods and agents as well. Although these other SWF files can carve out their own root reference for data storage etc.

3. Simply use the icon04.root reference and you will always know where the root of your movie is.

4. If you are comfortable with _parent use it, but be careful as you just might be moving the MovieClip holding your SWF. I think about the execution of my application as if it were loaded via loadMovie to a nested MovieClip.

5. When your app finishes execution, clean up _global:

delete _global.icon04

Cheers,

ted ;)

0 Responses to “Central _root & _level0 workaround...”

Post a Comment

Where to find me:

Ted on Twitter - @AdobeTed
Ted on Adobe Groups
Ted on LinkedIn
Ted on Facebook
Ted at Adobe


Latest

Lists

Links

Jobs

Flex Jobs
city, state, zip

Archives