ActionScript 1/2 :: Selectively Playing A Movieclip

May 10, 2011

What I'm trying to do is show a little explosion movie clip each time the player's ship gets hit by enemy fire.  I thought it would be similar to how my shield powerup works, but apparently it isn't -- or it is, and I'm just doing something wrong.  Here's the code for the shield business, to give an idea of how things are set up.  The shield movieclip is nested inside of the ship movieclip, and it only becomes visible when the ship collides with the shield powerup icon.  It runs for 240 frames, fades out and disappears.  What I'd like to do is have a multi-frame explosion movieclip inside there as well, which appears, plays once, then disappears, whenever the ship is hit.

[Code]....

View 8 Replies


Similar Posts:


Iterating Through An Array And Selectively Deleting Items

Dec 30, 2010

I'm making a very short text adventure, not one that will be all that fun, but just so I can learn a little as3. So I was designing a system that splits the persons input into an array of words, and then goes through and takes out unimportant words like "on." To test this out, I quickly (and messily) coded it up, and the only thing you can do is sit on a box. but it doesn't seem to be working. if you type "sit box" it works, but "sit on box" does not.

[Code]...

View 2 Replies

Flash :: Selectively Mask Parts Of The Stage?

Jan 24, 2011

I'm making flash game, and I have the staged masked so your character can only see part of it. However, I don't want the entire stage masked, I only want the "Game Area" masked. Imagine my stage is 800x800. However, the "Game" only takes up the area at the top, 800 by 600. There are 200px at the bottom where I can use for chatting, or displaying information, as your character walks around the game area.

The issue is, I setup my mask, and it masks /everything/ on stage. Even if I have something outside the "game area", it is still hidden behind the mask. So my question is, in my flash application, how can I use my mask in the "game area", and not have other parts of my application affected? Can I selectively put items above the mask?

Edit: Clarifying. My game starts by initialzing the GameScreen object:
game = new GameScreen(); //800 x 600. Declared as class variable
game.y = 40;
addChild(game);

[Code]....

So now, we have my game setup, with a circular hole in the mask and the player can see his character. However, also when the Game Screen object initializes, it places an infomation bar on the screen. This information bar also gets hidden by the mask. The player cannot see it. The issue is, I want this bar (and other components to be added later) to be visible to the player at all times. I can't simply change the shape of the "hole" through the mask, because it moves with the player. So how can I allow that information bar to be seen by the player, while still hiding the game area?

View 1 Replies

ActionScript 2.0 :: Selectively Pre-loading A Movie Clip?

Jul 24, 2007

I'm currently working on a Flash site with AS2 (I made the switch to Flash CS3 in the middle of the project and kept things in AS2 to avoid any potential problems). [URL]As you can see by going to the link the preloader takes a loooooong time. After going through the preloader tutorials I have still yet to find an effective way of making the preloader at the begging load only the opening animation or any other preloaders after that load a specific movie.

View 4 Replies

ActionScript 2.0 :: Get A Movieclip Within A Movieclip To Stop Playing When It Reaches Its Last Frame

Nov 20, 2007

i'm trying to get a movieclip within a movieclip to stop playing when it reaches its last frame. let me describe my problem: it should start playing when the user rolls over the movieclip that is containing it(i'll call this mc1, and the movieclip within it mc2). i've put a stop action in mc2's last frame but it won't stop and plays again and again. one thing i should point out is that there is a variable in mc1 that tells the movie whether it's ok to play the movie in reverse when the user rolls over mc1, if this is false, that means that it plays normally(not in reverse). i'm using "play()" to play mc1 when the user rolls over it and this is where i think the problem is; even though the last frame of mc2 has a stop action, it is somehow told to play again? anyways, this is just a guess, i haven't figured out why or how to fix it. i'm not sure if my explanation was too hard to understand so i'll try to clarify it if anyone wants me to.

View 1 Replies

ActionScript 3.0 :: Playing A Movieclip Using A Button?

Sep 15, 2009

I have two buttons named buttonOne and buttonTwo. When I click buttonOne, the movie clip named oneMc should play its intro and then stop then after that whenever I click buttonTwo, the movieclip oneMc should play outro animation and then movieclip twoMc intro comes in.

Do I need to use the Loader and URLRequest for this one? or use a String?Also, how can I call the movieclip to play its outro and play the next movieclip's intro?Here is my code so far...

buttonOne.buttonMode = true;
buttonTwo.buttonMode = true;
buttonOne.addEventListener(MouseEvent.CLICK, btnOneHandler);

[code]....

View 1 Replies

Pausing And Playing MovieClip Children

Jul 10, 2010

Pausing, stopping and playing movieClip (MC) children. I am making SWFs that an interface will load and control (pause, re-start, stop, etc.). Then the interface is paused, the main MC will pause but not it's child MCs. I didn't write the interface, I am just supplying SWFs that are loading into the interface. The developer of the interface willn't allow me to use animated MCs in my SWFs since he can't control them with the interface. So all my animation need to be on the main time line, which is no optimal to say the lease.Can I provide him with some code to allow him to stop the child MCs or is there an Event Listener I could include in the child MCs that would pause, stop, restart, etc when the main MC changes?I currently do not have a fix at this time and since all my animations are on the main timeline, is there a way to select multiple objects (on difference layers) and move and resize them across multiple keyframes?

View 1 Replies

ActionScript 3.0 :: Playing Next MovieClip After One Finished?

Oct 4, 2008

In as2 I am using:
_parent.gotoAndPlay(_parent._currentframe + 1);
to have one movieclip play and then when it finishes the next movieclip plays. How do I do this is as3?

View 14 Replies

ActionScript 1/2 :: Movieclip Animation Not Playing?

Jun 20, 2011

I have no idea why it doesn't work. I have a movieclip I make it go to frame lowWalk. mc_player2.gotoAndStop("lowWalk"); On that frame is another movieclip with an animation which should just automatically play and loop... but it doesnt, it stays on the first frame. Remember I tell it to go to frame lowWalk, which is 1 frame with a movieclip with an animation within. I even tried putting a play(); actions on the first frame inside the animation movieclip.

View 5 Replies

ActionScript 3.0 :: Playing A MovieClip In A Certain X Position?

Dec 6, 2011

I want to play video clip when it is dragged into the timeline I created. I handled the timeline and drag/drop part but I need that clip to play when button is clicked on. So I need to make my function determine the x position of the movieClip and play it if it is on the certain x value.

View 3 Replies

Actionscript 3 :: MovieClip Not Playing Consistently

Feb 3, 2011

So at the beginning when my SWF loads up it also loads up a sequence of animated clips like [code]...

And my clipLoaded function is[code]...

The clip4 file being loaded in has a stop() at the first frame. Later in the game (clip4 is the "outro") I use[code]...

However, the clip only seems to play about 25% of the time and all the other clips which I load the exact same way play fine. The only difference is that those clips get played fairly soon after they load which leads me to believe clip4 is being autoreleased at some point but I really have no clue.

View 1 Replies

Flash :: Determine Is MovieClip Playing Now?

Apr 17, 2011

I have movieClip (in as3) and I'd like to know is this movieClip playing now

View 2 Replies

ActionScript 2.0 :: Playing A Movieclip Backwards?

Nov 5, 2009

I hope someone will know a solution to this problem: I have a movieclip with a tween in it, which moves a object up and down.

I have 2 buttons on my _root: One which had to move the object up till the end of the movieclip when pressed so it will stop after reaching the end of the tween. Or it stops playing when the button is released.

Another one doing exact the oposite, it moves the object down when pressed. And should stop at the beginning of the tween. This button also has to stop when the button is released. The button playing the movieclip backwards doesn't work as it should be. It doesn't reverse the movieclip, it just jumps to a previous frame.

View 1 Replies

ActionScript 3.0 :: Playing A Movieclip At A Different Speed?

Mar 10, 2012

I'm finding in my current project, a need for a method of playing animations (MovieClips) at a speed that is different from the stage framerate. I need to dynamically adapt animations, which i've created natively at 20fps, to play at 10, 40, or any other arbitrary value. Of course frame skip/stall is most likely the only way to do this - that is when playing slowly the animation may stay on the same frame for a number of stage frames, eg 1,1,2,2,3,3 etc.. and when playing fast, may jump over several frames to advance the animation faster (at the cost of a minor loss of smoothness, but that's fine.) eg, 1,4,6,9,11,14 etc. (the size of jumps wouldn't always be consistent)

View 3 Replies

ActionScript 2.0 :: Playing A Movieclip While Preloading?

Apr 6, 2007

I am trying to figure out how to connect a preloader with a movieclip I made. Essentialy what I want to happen is for the heart graphic to start out black and white and as the percentage preloaded increase, the color version of the heart I masked will appear. Here is the link to the .FLA file. I have a basic mask over the colored version of the heart that I motion tweened to move. Now that I have this setup, how do I plug it into a preloader to enable it to sub as a load bar. Partially coloring the image as more of the document is loaded.

[URL]

View 8 Replies

ActionScript 2.0 :: Playing / Sopping MovieClip When W And S Keys Down

Jan 31, 2009

I've got a movie clip instanced as "ground", with stop(); in the first frame, and I want it to play if either the S or W keys are down, but stop when neither are down.

I've got:
PHP Code:
var myListener:Object = new Object();
myListener.onKeyDown = function() {
if (Key.getAscii() == 87 || Key.getAscii()== 83) {
_root.ground.play();
}else{
_root.ground.stop();
}}

In on the root frame. Though, obviously this doesn't work.

View 4 Replies

ActionScript 3.0 :: Playing A Movieclip Upon Enter Frame?

Mar 15, 2009

I am trying to play a simple movie clip when the playhead gets to a frame label called "home". The moveclip is called "playRollClick".I am trying to write this in as3.The code below is what I've come up with so far, but it doesn't seem to work.

addEventListener(Event.ENTER_FRAME,playRollClick);
function playRollClick(event:Event) {
rollClick_mc.play();
}

View 2 Replies

MovieClip Not Playing After Drag And Drop On Stage

Mar 17, 2009

I dragged and dropped my movie clip on to the stage, and it doesn't play. Other movie clips play, but the one I need to use doesn't play. I even added a function that is supposed to play the clip when you click on another clip, and it doesn't work although others do. I've attached the fla for reference, the clip that I'm trying to use is wipe3.

View 1 Replies

ActionScript 3.0 :: Tell When MovieClip's Animation Has Finished Playing?

May 15, 2009

I'm just wondering if there is an event for MovieClips that tells when the MovieClip's animation has finished playing. Basically, I have an explosion movie clip that I put on the stage. I want to have it animate once through it's loop, then remove itself.

View 1 Replies

Playing MovieClip With Different Frame Rates From Document

Jan 16, 2010

If I have a flash document, that's set at 12 FPS.... can I make certain movie clips play at like 30 FPS even though the main document is set to 12?

View 2 Replies

ActionScript 2.0 :: Invisible Btn Not Playing Movieclip On Rollover?

Apr 26, 2010

I'm using AS2 (Flash CS3). I have an invisible button that on rollover should play a movie clip. Within that movie clip I need it to play frame 33. However, when I use the following code it does absolutely nothing. Instance name of the movie clip is "flavorIcons".

on (rollOver) {
flavorIcons.gotoandPlay(33);
}

View 2 Replies

ActionScript 3.0 :: MovieClip Sound Not Playing On MouseEvent?

Jul 13, 2010

Why won't my sound play? It should play on Mouseover and stop on Mouseout.

stop();
import flash.display.MovieClip;
import flash.events.MouseEvent;
var req:URLRequest = new URLRequest("squeeak.wav");
var sound:Sound = new Sound();
var controller:SoundChannel;
function soundLoaded(event:Event):void{
controller = sound.play();
[Code] .....

View 1 Replies

ActionScript 3.0 :: Timer Delay Before Playing Movieclip?

Jul 29, 2011

I have a "News Bar" on my flash site that plays a movieclip I created to display the news. I would like a one-time delay of around 2.5 seconds before the movieclip starts playing. I'm comfortable with flash and am learning AS3 more and more everyday.

View 2 Replies

ActionScript 3.0 :: Detecting When The MovieClip Finished Playing?

Oct 28, 2009

i want to play an animation that is converted into a movieclip and indicate success of that level and then after the movieclip is finished playing then i want to run a function which will bring user to the next level.

View 4 Replies

Actionscript 3 :: Listen For The Completion Of A MovieClip Playing?

Jul 29, 2010

I want to execute a function upon completion of a MovieClip's animation. That is, I would command it to play() or gotoAndPlay(). I don't know of any listener that I can attach to the MovieClip with the "addEventListener()" command. Have any idea I can do?

View 2 Replies

ActionScript 3.0 :: Finish Playing Movieclip Before Going To Particular Scene?

Jun 27, 2010

Basically I'm doing a flash website for my 3D animations. Once my intro animation ends my menu comes up which is within a main movieclip called menustage_mc and within that movieclip is a bunch of movieclips acting as buttons to navigate through the site and their animation.When you press on a button it will move to a particular scene. I'm using multiple scenes so i don't clutter the main timeline for myself. I've read a couple of posts saying that i shouldn't use multiple scenes but there is no explanation as to why. I'm assuming i should add and remove movieclips but i'm very new to actionscript and in particular as3 but that's a different question somewhere down the line.

My problem is that when i click on a button for example sketches, i want to finish playing the menustage_mc animation and then go to the sketches scene. However i'm trying different variations and am not getting any success. There are instances where the animation plays but then doesn't go to the next scene. Another instance is that it goes straight to the selected scene but doesn't finish playing the menustage_mc.So all I really want to do is finish playing the menustage_mc animation before it goes to the correct scene? I have seen things where I can go the menustage_mc and put nextScene(); on the final frame but it's not what i am really aiming to do.

View 0 Replies

ActionScript 3.0 :: Playing External Loaded Movieclip

Sep 6, 2010

I need to load a external file as movieclip and play according to the mouse movements. External swf consit of panning sequence in which i have to stop in 122 frame when my mouse is between 250 and 1000 x position.

But my problem is the loaded movieClip plays fine in first time when i return to the position movieclip does not play good. animation becomes jerky.

here is my code

ActionScript Code:
package
{
import flash.display.MovieClip;
import flash.display.Loader;

[Code]....

the loaded swf file is about 2 mb and consist of diferent flv embede in timeline

View 1 Replies

ActionScript 2.0 :: MovieClip - Playing All Animations At Right Time

Jul 11, 2008

I am trying to make this movie clip (presenter1) to play all is animations at the right times, when it starts the movie clip should be on the frame label rock which is frame 1 then on rollover it should go to frame label gesture which is frame 2 onRelease it should go to frame label walk which is frame 3 then if its already on the walk frame then go to walkback which is frame 4.

Code:
Select allpresenter1.onRollOver = function () {
if (frame = "walk") {
stop(); }
else if (frame = "rock") {
this.gotoAndPlay(2);
}}
presenter1.onRollOut = function () {
[Code] .....

View 7 Replies

ActionScript 2.0 :: GotoAndPlay - MovieClip On 3rd Frame Not Playing

Aug 3, 2004

I'm making a flash site but I'm having a little problem: I preload my site with this code:
Code:
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded / bytes_total;
this.loadBar._width = getPercent * 200;
this.loadText = Math.round(getPercent * 100) + "%";
if(bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}
This code works perfectly when I test it, but if it goes to frame 3, the MC's on that frame won't start playing... ? If I just remove the frames with the preload bar (so frame 3 becomes frame 1), all works perfectly...

View 3 Replies

ActionScript 2.0 :: Movieclip To Carry On Playing Even When Not On Stage?

Aug 10, 2007

I have a movieclip called MC1 and within that 2 frames each containing movieclips called MC2 and MC3. The user can change between the two movieclips and MC3 has a animation within it. Once MC3 is activated, its animation plays but when the user changes to MC2 and then to MC3, the animation is back at the beginning, I want it to keep going even when the user changes to MC2 so when he switches back, the animation is still carrying on.

So basically, I need to know if there is way to have the movieclip playing even if it is not on stage.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved