movieclip

Play MovieClip frame by frame in addition after same function is executed several times

若如初见. 提交于 2019-12-12 00:26:55
问题 I have a MovieClip named fails_mc, it consists of 3 soccer balls and in my game every time my player fails I need to add an X mark over 1 ball, I have a hitTestObject detecting when the ball hits the goal area, but when the ball goes outside I need to play 1 frame inside the fails_mc and add the X mark to a ball ( I have 3 different png files inside fails_mc, 1 on each frame), this is the code I’m using but I don’t know how to play frame by frame the fails_mc (keep in mind that the same

Actionscript how to get name of instance using getChildByName

谁说胖子不能爱 提交于 2019-12-11 20:05:38
问题 Okay so I have a MovieClip called sC and need to write a code where, if you click the button (sC) then sC will dissapear. The function needs to work for multiple buttons. What I tried was sC.addEventListener(MouseEvent.CLICK, clickHandler); function clickHandler(event:MouseEvent):void { var self; self = MovieClip(getChildByName(event.target.name)); self.visible=false; Now when I try this code, it gives me an error when I click sC. It says "cannot access a property or method of a null object

Button to play a movie within a movie in ActionScript 3 Presentation

▼魔方 西西 提交于 2019-12-11 16:16:42
问题 I am making a Flash Presentation, so each animation is within a movie clip (movie_mc). This movie clip has a key frame holding each animation (4 keyframes/animated slides). The first movie instance/slide is called "slide1871". I labeled the first frame within this movie "slide1871". My buttons are on the main timeline. I CANNOT get the code to work to link to play the first frame of movie slide1871 (within movie_mc). It either doesn't work at all, or it plays the 4 keyframes of the 4 slides I

Playing a video with MPMoviePlayerController in Portrait WITHOUT Private API - Will I get rejected by Apple?

佐手、 提交于 2019-12-11 15:46:05
问题 It's my understanding that MPMoviePlayerController movies must play in landscape orientation because the "setOrientation:" function is private API. Well, it occurred to me that if I were to rotate the video 90 degrees in Final Cut and then re-render, the video would APPEAR to be playing in portrait orientation even though it was technically playing in landscape. I would simply have to disable the play controls to complete the effect (which is okay). Could I my app still face rejection if I

AS3 Button to stop Movieclip after its finished playing

扶醉桌前 提交于 2019-12-11 14:05:51
问题 Ok, so I'm a beginner at AS3 and Flash and I managed to put this code together for an animation. A Button called start_btn is supposed to start and stop a movieclip called main_mc. On the first click of the Button, the Movieclip is supposed to play (which it does), however on the second click, the movie stops in the middle of its animation (which I don't want). My question is, when you click the Button a second time, how can i get the Movieclip to finish playing its animation then stop on the

ActionScript: Adding multiple instances of the same swf file to the stage

你离开我真会死。 提交于 2019-12-11 07:44:21
问题 I'm creating a game in ActionScript 3.0 using the FlashPunk game engine and the FlashDevelop SDK. I've created my own MovieClip class that takes a preloaded movie clip file. public function MyMovieClip(file:MovieClip, posX:int, posY:int, frameRate:int) { movieClip = file; movieClip.x = posX; movieClip.y = posY; movieClip.stop(); FP.stage.addChild(movieClip); timer = new Timer((1 / frameRate) * 1000); timer.start(); timer.addEventListener(TimerEvent.TIMER, onTick); } The update for my movie

Evaluate a path string which contains a nested movieclip in AS3

牧云@^-^@ 提交于 2019-12-11 04:13:21
问题 This should be fairly simple but I understand why it doesn't work. I am hoping there is a clever way to do the following: I have a string 'movieclip1.movieclip2' I have a container movieclip - Container. Now to evaluate the string normally I would look something like: this.container['movieclip']['movieclip2'] Because clip2 is a child of movieclip. But I would like to parse or evaluate the string with the dot syntax to read the string as a internal path. this.container[evaluatedpath]; // which

as3 play movieclip once

折月煮酒 提交于 2019-12-11 03:27:26
问题 I would be very thankful if you help me with this problem. I´m trying to play in my application for ipad one MovieClip once. i tried to do stopping in this way, but the movie dont stop var loader:Loader = new Loader(); var swfFile:URLRequest= new URLRequest("/test.swf"); loader.load(swfFile); movieClip = new MovieClip(); movieClip.addChild(loader); movieClip.addFrameScript(movieClip.totalFrames - 1, callbackFunc); movieClip.play(); private function callbackFunc():void { movieClip.stop(); }

AS3 setChildIndex to front

独自空忆成欢 提交于 2019-12-11 02:48:19
问题 Is there a way to send a specific movieClip to the front of all other movieClips on stage? I know about setChildIndex, but I can't figure out a way to to calculate the top position dynamically. 回答1: You can use setChildIndex() with numChildren . setChildIndex(childClip, numChildren - 1); 回答2: You don't need to use setChildIndex. addChild is sending child on the top of all clips. You may be thinking that addChild will double add your MC, but it will not, the second time it will just update it

Why is AS3 creating new instances in for loop?

社会主义新天地 提交于 2019-12-11 02:34:58
问题 Strangest behavior I have seen from actionscript so far and I have been working with AS for over 10 years. var clip1:MovieCip = new MovieClip(); var clip2:MovieCip = new MovieClip(); var clip3:MovieCip = new MovieClip(); var clip; var myarray:Array = new Array(clip1, clip2, clip3); for each (clip in myarray) { removeChild(clip); clip = new mc(); trace(clip.name); } seems simple enough right? well for some reason flash is changing the instance names to instanceX where X is some randomly