Saturday, February 17, 2007

You want to dynamically call a certain movieclip before a movieclip is run.

Problem: You want to dynamically call a certain movieclip each time before a movieclip on the timeline is run.

Solution:This can be achieved using attachMovie() and removeMovieclip() methods.

Lets see how this can be done.

Open a new document in Flash.
Create a circle(or any shape you want) and convert it to a moviclip.
Craete a small tweening animation of 25 frames.Now we have got a nice looking animation.In the last frame copy and paste this code

_root.gotoAndPlay(2)
this.removeMovieClip()
stop();


Then convert it into a new symbol.Give it a suitable name such as "transition" and let the identifier name remain "transition".Also select both checkboxes i.e, Export for Actionscript and Export at the first frame.

Open a new document and from the library drag the transition movieclip into the stage.Then delete it.Now this clip resides in the library of the new document.

In the First frame attach this code

_root.attachMovie("transition", "abc", 10);
stop();


Go to Frame 2 and create another movieclip and create small tweening animation.

Now test the movie.You will see the transition movie will play first and after it finishes the playhead will sart playing from frame 2 onwards.

Posted by Ashwinee Dash at 4:51:55 AM in ActionScript Notes (1) | Comments (0)

Comments

Name
URL
Email
Email address is not published
Remember Me
Comments

CAPTCHA
Write the characters in the image above

Menu

  • Home
  • About
  • Rules
  • Gallery
  • Contact
View Ashwinee Dash's profile on LinkedIn Digg!
  • EverythingFlex
  • Pushing the boundaries
  • Flex Notes

Search



Categories

  • ActionScript (5)
  • ActionScript Notes (1)
  • AIR (2)
  • Announcements (5)
  • e-Learning (3)
  • Flex , Flash and Apollo apps (10)
  • Miscellneous (2)
  • RIA (3)
  • Web Design (2)
  • Web Developement Notes (3)

Archives

  • July 2008
  • February 2008
  • October 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • January 2007

Recent Entries

  • Notice
  • Ruby
  • Rinfo- E4X in Flash CS3 experiment
  • Flickrin 2.0 updated to run in AIR runtime
  • Apollo JukeBox released as AIR JukeBox
  • Apollo apps to be updated soon
  • So, where's your mp3 player, Dude ?
  • Flickrin 2.0 tutorial posted
  • Flickrin 2.0 released
  • Flickrin :A Flex-Apollo-Flickr mash up

Meta

  • Syndicate this site (RSS XML 2.0) RSS Feed

Errata

  • Admin Login
© 2007 , Ashwinee Dash,www.ashwineedash.com