Ted Patrick > { Events & Community } > Adobe Systems


Central _root & _level0 workaround...

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



Jobs


Flex Jobs
city, state, zip


© 2008 Ted On Flash