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 //

RSSComments

You must login to post comments. Login
 

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: qdcZidentifierQSxhttpE3aE2fE2fblogsE2eforumE2enokiaE2ecomE2fblogE2fliE2dyongfeisE2dforumE2dnokiaE2dblogE2f2009E2f02E2f11E2fallE2dflashE2dliteE2denabledE2dnokiaE2dphonesX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZBlogContentQ qdcZtypeQUqfntypeZBlogE45ntryQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZflashQ qfnZtypeQUqfntypeZBlogContentQ qfnZtypeQUqfntypeZBlogE45ntryQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZuserE5ftagQSxflashX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZBlogContentQ qrdfZtypeQUqfntypeZBlogE45ntryQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ