movieclip

How do you get Polygons from MovieClips in Flash?

 ̄綄美尐妖づ 提交于 2019-12-10 15:24:05
问题 I have an actionscript that reads an swf and goes through movieclips in it. The movie clips should be simple shapes. I want to convert the data in these movieclips to a polygon. In other words, I want a series of coordinates that represent the shapes on the movieclip. 回答1: There's no easy way to do this. Once a shape is drawn to the stage, the only graphical information you can access is the rendered pixel bitmap; all vector information is lost. To transform shapes into polygons, you'll have

AS3 - Movie Clip animations (undesirably) bob up and down. [Playable SWF included]

和自甴很熟 提交于 2019-12-10 11:55:18
问题 Im making a game where the player controls a movieclip (_character) around the stage with the arrows or WASD. On the stage there are squares/boxes with collision detection. Plus a 50 pixel stage boundary. _character has five key frames, each with an animation inside, which plays when the four direction buttons are pressed, plus the red stationary animation when no keys are pressed. While moving the characters body and head should be still, with the legs moving. Example below _character Right

How do I know when MovieClip placed on stage to finish play?

牧云@^-^@ 提交于 2019-12-08 01:50:43
问题 MovieClip(mcName).play(); MovieClip(mcName).addEventListener(??????, myStopFunction); Or how differently you can learn about the end of play? MovieClip is an external file and loaded into the swf as needed. 回答1: Use two properties all MovieClips have: totalFrames - currentFrame http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/MovieClip.html#currentFrame http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/MovieClip.html#totalFrames 回答2: When I have a

AS3 get Bitmap from Movieclip with Mask

醉酒当歌 提交于 2019-12-06 07:21:32
问题 This works: var a:BitmapData = new BitmapData(640,480); var b:Bitmap = new Bitmap(a); a.draw(movieClip); This doesn't work: movieClip.mask = movieClipMask; var a:BitmapData = new BitmapData(640,480); var b:Bitmap = new Bitmap(a); a.draw(movieClip); How can I draw just the visible part of a MovieClip (that uses a mask) into my Bitmap? 回答1: Create a new Sprite and add both the MovieClip and its mask to it. Then draw the parent Sprite. var container:Sprite = new Sprite(); container.addChild

AS3 get Bitmap from Movieclip with Mask

岁酱吖の 提交于 2019-12-04 12:44:28
This works: var a:BitmapData = new BitmapData(640,480); var b:Bitmap = new Bitmap(a); a.draw(movieClip); This doesn't work: movieClip.mask = movieClipMask; var a:BitmapData = new BitmapData(640,480); var b:Bitmap = new Bitmap(a); a.draw(movieClip); How can I draw just the visible part of a MovieClip (that uses a mask) into my Bitmap? Create a new Sprite and add both the MovieClip and its mask to it. Then draw the parent Sprite. var container:Sprite = new Sprite(); container.addChild (movieClip); container.addChild (movieClipMask); movieClip.mask = movieClipMask; var a:BitmapData = new

How to make a MovieClip remove itself in AS3?

淺唱寂寞╮ 提交于 2019-12-04 03:29:44
问题 What is the equivalent to removeMovieClip() in AS3? Apparently many have the same question: StackOverflow: How to completely remove a movieclip in as3 Remove movie clip as3 How to remove childmovieclip and add to new parent movieclip Others: removeMovieClip(this) in AS3? Destroy/Delete a Movieclip??? Remove movie clip But none of their solutions seem to work, for me: Im working on flash CS4 with AS3 : I have a very simple movie with a single button called click . On pressing the button, a new

How to maintain a movieclip's color between frames?

▼魔方 西西 提交于 2019-12-02 11:12:29
My app has 2 frames; in frame 1 there are 5 MC and on a DOUBLE_CLICK event the target's color change and go to the next frame 2. In frame 2 I have a button to return to frame 1. How can i maintain the MC color when I return to frame 1? public class test extends MovieClip { public function test() { var myMCTable:Array = [myMC1, myMC2, myMC3, myMC4, myMC5]; for (var i:uint = 0; i < myMCTable.length; i++) { myMCTable[i].doubleClickEnabled = true; myMCTable[i].addEventListener(MouseEvent.DOUBLE_CLICK, changeColor); } } private function changeColor(e:MouseEvent) : void { var newColorTransform

AS3 - Button inside MovieClip triggers MC's event

时光总嘲笑我的痴心妄想 提交于 2019-12-02 04:15:49
问题 On stage, I have a MovieClip named "mc" with a simple rectangle drawn inside. mc also has a Button child named "btn" which is another simple rectangle ( smaller than mc's rectangle obviously). Then I have this code on stage. function mcDown( _e:MouseEvent):void{ trace( "mc" ); } function btnClick( _e:MouseEvent):void{ trace( "btn" ); } mc.addEventListener( MouseEvent.MOUSE_DOWN, mcDown ); mc.btn.addEventListener( MouseEvent.CLICK, btnClick ); The problem I am having is when click the button,

How to check if mouse is over a MovieClip?

岁酱吖の 提交于 2019-12-02 04:05:14
No listeners involved. The thing is, I can use MOUSE_OVER and MOUSE_OUT listeners, but if you drag a mouse over a MovieClip quickly enough, one of these listeners may not be activated. I've tried it several times. If the mouse passed by "quickly enough" then maybe the OS didn't send any mouse events to Flash for that portion of the screen, in the first place. Moving the mouse a lot faster than its resolution can fire (or the OS can handle) will have the effect you are witnessing (and the truth is, no mouse events were handled for that portion of the screen), otherwise MOUSE_OVER will surely

AS3 - Button inside MovieClip triggers MC's event

大憨熊 提交于 2019-12-02 00:22:58
On stage, I have a MovieClip named "mc" with a simple rectangle drawn inside. mc also has a Button child named "btn" which is another simple rectangle ( smaller than mc's rectangle obviously). Then I have this code on stage. function mcDown( _e:MouseEvent):void{ trace( "mc" ); } function btnClick( _e:MouseEvent):void{ trace( "btn" ); } mc.addEventListener( MouseEvent.MOUSE_DOWN, mcDown ); mc.btn.addEventListener( MouseEvent.CLICK, btnClick ); The problem I am having is when click the button, mcDown event is also triggered and traces both "mc" and "btn". How can I make it so that when I click