You Are Here:

Community: Blogs

Faisal Iqbal's Forum Nokia Blog

Flash Lite: Effectively using gotoAndPlay & gotoAndStop

chall3ng3r | 18 February, 2008 21:57

Hey all,

This is my first post regarding the Flash Lite tips'n tricks I am planning to share on this blog. So, lets get started.

As Flash Lite 1.1 supports pre-AS1 Flash 4 scripting syntax, the developer have to use tellTarget statement to access objects from deferent object.

For example if there are two objects on the stage, menu_mc and controller_mc. To perform a quick gotoAndPlay action from controller_mc to menu_mc, you might be using the following code:

tellTarget("../menu_mc")
{
    // play SlideUp frame
    gotoAndPlay("slideUp");
}

While this works pretty well, but you can also do this via just a single gotoAndPlay call. gotoAndPlay and gotoAndStop also accepts paths, so you can simply pass the object path along with frame label or number to goto command. Like the same operation we did with tellTarget above can also be done as follows:

// play SlideUp frame
gotoAndPlay("../menu_mc:slideUp");

You can use relative paths as well as absolute paths with this approach.

This trick is quite useful when you have to do a quick goto action, but if you need to perform multiple actions, then you're good to go with tellTarget.

Update: BTW, you can use the same trick with latest versions of Flash / Flash Lite.

Update: Scott has posted a nice example use of this tip on his blog, check it out.

Stay tuned for more!

// chall3ng3r //

 
 

Rate This

 
 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZrelationQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fschemasE2fnokiaE2fFNE2d1E2e58E2eowlX qdcZtitleQSxForumE20NokiaE20BlogsE20WebE20SiteXLen qdcZtitleQSxForumE20NokiaE20BlogsE20WebE20SiteXLen qdcZtypeQUqfnZE44istributionQ qdcZtypeQUqfnZSiteQ qdcZtypeQUqvocZTermQ qdcZtypeQUqvocZVocabularyConstructQ qdcZtypeQUqwebZSiteQ qdcZtypeQUqrdfsZE52esourceQ qswZserviceQUxhttpE3aE2fE2fswE2enokiaE2ecomE2furiE71aX quriE71aZserviceQUxhttpE3aE2fE2fswE2enokiaE2ecomE2furiE71aX qvocZpartOfQUqfnZPublicationQ qwebZserviceQUxhttpE3aE2fE2fswE2enokiaE2ecomE2furiE71aX qrdfZtypeQUqfnZE44istributionQ qrdfZtypeQUqfnZSiteQ qrdfZtypeQUqvocZTermQ qrdfZtypeQUqvocZVocabularyConstructQ qrdfZtypeQUqwebZSiteQ qrdfZtypeQUqrdfsZE52esourceQ qrdfsZisE44efinedByQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fschemasE2fnokiaE2fFNE2d1E2e58E2eowlX qrdfsZlabelQSxForumE20NokiaE20BlogsE20WebE20SiteXLen qrdfsZlabelQSxForumE20NokiaE20BlogsE20WebE20SiteXLen qrdfsZseeAlsoQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fschemasE2fnokiaE2fFNE2d1E2e58E2eowlX