Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 08-18-2012, 03:20 AM   #1
adamV
Registered User
 
Join Date: Mar 2009
Posts: 35
Default Drawing Bitmap Data to Single MovieClip Frame

Basically I have a template movieclip with several frames for different "States". Each is the character's facing and other actions. I'm calling for the graphic data from an external file to be drawn to each frame with bitmap data.

The issue here is that when I do this, it draws the data to ALL of the frames. I tried making the character go to different frames when he's being drawn, but the flash just draws it to all.

If you could help that'd be greatly appreciated. Thanks. Let me know if you need more information as well.
adamV is offline   Reply With Quote
Old 08-18-2012, 05:01 AM   #2
Mazoonist
Site Contributor
 
Mazoonist's Avatar
 
Join Date: Jun 2006
Posts: 3,160
Send a message via AIM to Mazoonist
Default

You cannot dynamically draw graphics to specific frames of a MovieClip. There is no such thing. MovieClips originally were an authoring-time affair intended for you to be able to create animations, hence their use of frames. To this day, the only way to place things on specific frames of a MovieClip is in the Flash authoring tool. You can't do it with code.

However (as you are experiencing), you can dynamically add graphics to a MovieClip using addChild(), because MovieClip is a DisplayObjectContainer. You just can't place the graphics on any specific frame. There just is no way to do that. However, rather than using frames, you could just use the visible property to show and hide your bitmaps. Write a function that shows one bitmap and hides all the others. It will have exactly the same effect visually as gotoAndStop().
__________________
My Tutorials * My Website
Mazoonist is offline   Reply With Quote
Old 08-18-2012, 07:26 AM   #3
adamV
Registered User
 
Join Date: Mar 2009
Posts: 35
Default

Quote:
Originally Posted by Mazoonist View Post
You cannot dynamically draw graphics to specific frames of a MovieClip. There is no such thing. MovieClips originally were an authoring-time affair intended for you to be able to create animations, hence their use of frames. To this day, the only way to place things on specific frames of a MovieClip is in the Flash authoring tool. You can't do it with code.

However (as you are experiencing), you can dynamically add graphics to a MovieClip using addChild(), because MovieClip is a DisplayObjectContainer. You just can't place the graphics on any specific frame. There just is no way to do that. However, rather than using frames, you could just use the visible property to show and hide your bitmaps. Write a function that shows one bitmap and hides all the others. It will have exactly the same effect visually as gotoAndStop().
Wow that's a really good idea. Thanks for the tip!
adamV is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:39 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.