play several movieclips with actionscript 3.0

Hello

I have a page that has 3 buttons on it. Each of these buttons activates a different movieclip on the timeline. (each movieclip is

on its own layer.) I think I'm almost there with her because I am not getting any errors in my code (actionscript 3.0), but when I click on

one of these plays my calendar just to the end without worrying. Help, please


Here is my code...

Stop();

btn_1.addEventListener (MouseEvent.Click, ButtonClicked)

function playMC_one (event: MouseEvent): void

{
MC_one. Play();
}

btn_2.addEventListener (MouseEvent.Click, ButtonClicked)

function playMC_two (event: MouseEvent): void

{
MC_two. Play();
}

btn_3.addEventListener (MouseEvent.Click, ButtonClicked)

function playMC_three (event: MouseEvent): void

{
MC_three. Play();
}

Glen

When you add the listener to an object, you must call the appropriate function.

So instead of:

btn_1.addEventListener (MouseEvent.Click, ButtonClicked)

You must have:

btn_1.addEventListener (MouseEvent.Click, playMC_one)

Your code is:

Stop();

btn_1.addEventListener (MouseEvent.Click, playMC_one)

function playMC_one (event: MouseEvent): void

{
MC_one. Play();
}

btn_2.addEventListener (MouseEvent.Click, playMC_two)

function playMC_two (event: MouseEvent): void

{
MC_two. Play();
}

btn_3.addEventListener (MouseEvent.Click, playMC_three)

function playMC_three (event: MouseEvent): void

{
MC_three. Play();
}

Hope this has solved your problem.

Kind regards

Amandine

Tags: Adobe Animate

Similar Questions

  • Several movieclips with export even for LIKE names? Possible?

    LS,

    I'm working on an application for mobile devices.

    The dimensions of some of them, i.e. phones by opposition to the tablets, with a much smaller screen, wanted to use different sets of mc depending on the size of the screen (wise device size, no resolution).

    If a smaller unit would use the largest MC with gfx and so they would always decipherable and the larger machines could use more small gfx so be abale to get much more on the screen at the same time

    -I could just scale the clip of the entire screen all the time, but it will slow it down too I think

    -I could create multiple instances and use different names and then the sort of moment of execution have, but it would also steal time processor. Im not really for this.

    -I could publish several versions, depending on device sound for. But that would require me to maintain several sources on upgrades. I can feel the pain already.

    I was hoping somehow, it is possible to export the movieclips .swf or something and then sort out the run time that an import/use/charge.

    So, I hope that I can refer to them in my code with the same name, but they will be of different sizes that I had chosen to include/load.

    Makes no sense?

    Any info on what is the best way to proceed is appreciated.

    Kind regards

    Mac

    If you want to resize an object in your application and have that resize objects the latter added to your application, add a sprite of parent at the beginning of your application, and then all other display objects must be added to this sprite of parent.

    You can then resize the sprite and resizing will affect all objects added these.

  • Play several video - with sound

    Hello Forum members

    I am a newcomer in terms of flash and action script, self-taught and Adobe forum and educated internet. I can now click a button and stop and start a clip, use attachMovie and even cut his in a video (no video). I am currently using Flash 8 and wait for CS3 (downloaded a demo and like better than Flash 8).

    Enough history - now to my question - I have an application that had 3 scenes. I read in an article by Adobe
    "Recommended flash" that it was not a good idea to use scenes in an application. I converted my stage 2 and 3 from the scene in video clips.

    I thought I could either put each video clip on a layer separate in my timeline (mc_scene2, mc_scene3)
    and to play them, one after the other (not worked well, later). Or...
    Copy deadlines from the sidelines and add these images of my scene 1, making a request to these two offbeat scenes one after another in the main timeline. Or...
    Keep the scene 1 and the end of scene 1, attacheMovie ("mc_scene2", etc.) and when the stage 2 was playing and or attach the clip of the final film (mc_scene3).
    I couldn't know how to know when mc_scene2 was done using the attacheMovie method, so I could then contact mc_scene3, etc.

    How will I be able to tell when a home or loaded movie clip is finished and then start the following?
    Or what is the way suggested to use actionscript to load a movie, play and when the video is finished, load and play the next, etc.

    Thanks for a good forum,

    eholz1

    put a stop(); actions on chassis 1 times your mc_scene MCs. place both on stage at the end of scene 1. and fix it on the frame, that they are

  • ? play several .flvs rule with single control bar?

    It's bugged the heck out of me.

    What I'm trying to accomplish:

    -load two external .flv files
    -two files begin to play simultaneously
    -control of games bar controls the two videos

    Why do I need to do this:

    I have a Flash environment. Each character in the environment is a .flv file. The characters interact with each other. The way I see it, this can be accomplished one of two ways:

    -two (for the two characters) flv files that run to the same exact duration
    -several flv for each character for always interaction files (I'm a little against that, because I care for the videos to load completely before starting)


    What I tried:

    -The FLV PlayBack component: this does not really work, since reading skin is visually connected to only a single video. In addition, it only controls a single video.

    -Playback FLV Custom AI: I still have to make it work even with a single video. However, I wonder still if it is perhaps the best solution, since I can place the PlayBar anywhere on the screen and should be able to generate scripts for two video playback controls. As I have said, however, I was not able to run at all.

    -J' built an original prototype of this in Captivate. Play several videos to YouTube (simultaneously or not) with a bar reading single skin for the whole project was easy. The problem I ran into was that the components of test in Captivate question did not what I need (aging of and becomes inactive when selected, able to try again)


    Can you help me?
    Thoughts? Suggestions? Anything is appreciated.

    I took end way think this, and it's the simplest of answers...

  • How to control an external SWF loaded with actionscript

    It is a question of both parties, and I'm pretty new to Flash. I'm working on a flash animation and the interface is a small town (simiar to "doritos.com" and "comcasttown.com"), if you are referencing the doritos comcast sites and their little movie gently. I have several items in the city. For example, one of the elements is an airplane hanger. When you reverse the hanger, I created a movie, the doors open and a plane flies out of the hangar. I have several small films throughout the interactive like this. I created the hangar as a separate swf file animation. In my main movie, I created a button bearing, it loads the SWF hangar in an empty movieclip. When I publish and display the swf file, it plays slow and jerky. First of all, is it possible to write an actionscript to load external swf file, but it will stop on the first frame of the animation, and when you the reversal, he continues to play.  To put all this in a Word, I want to create several buttons throughout the movie with loadmovie functions, once loaded swf movies I want to that they stop on the first frame of the animation and when you charge rolling video swf I want to continue to play the animation. ActionScript should be applied for swf movies first and preloaded in the main movie. And what will make the movies smoothly once he published and displayed in a browser.  Also, if that makes a difference, I created animations in sequels, exported as imported into flash FLVs and exported to the swf. Again, it works really slow and jerky. I'm taking the right approach?  I know it's a lot of information, but any help would be greatly appreciated. Here is the script I used for the button.


    on (rollover) {loadMovie ("movies/solarpanel.swf", "solarload");


    Thank you

    1. export a SWF of sequels.

    2. Add a stop() on the first frame of your SWF so they don't start playing while they are loading.

    3. apply mouse on your target movieclips managers and using the play() method to start your SWF play when postponed:

    {target1mc.onRollOver = Function ()}

    This.Play ();

    }

    and if you want them to stop when roll-out:

    {target1mc.onRollOut = Function ()}

    This.Stop ();

    }

  • If I can reverse a Tween created with the GUI... .with actionscript?

    Hi all

    I'm newer Flash, so it does not take much for granted. I have large gaps in my understanding.

    I created a motion tween (by good service a movieClip on the timeline and selecting 'create the motion tween'). Now I want to reverse the trend (using the term of "yoyo") when the audio file is played. I know how to do this with an interpolation (using the tween class) which was created in the first place with actionscript. How can I do overturn if interpolation is not already (named and included) my actionscript?

    Thank you

    If you tween is in a MovieClip you can actually play the MovieClip it back like this:

    addEventListener(Event.ENTER_FRAME, enterFrame);
    function enterFrame(e:Event):void {
          prevFrame();
    }
    

    I do it all the time.

    -Aaron

  • Read the part of a URL with ActionScript?

    Hello. I was wondering if it is possible to read a part of a URL with ActionScript...

    ... For example, if I have three specific sites by country:

    * www.somewebsite.com
    * www.somewebsite.com.uk (United Kingdom)
    * www.somewebsite.com.ca (canada)

    I just want to make a Flash file I can load on three sites, but according to the site on which is pulled up, the file will do something different. So (in plain English) I mean:

    If the URL contains '.uk', do something.
    If she ".ca", do something else.
    If she didn't do a third thing.


    How I would write only in ActionScript, or is it still possible to read the URL of the page that plays on the .swf movie?...

    Thank you!...

    DIY_Lobotomy

    > Hello. I was wondering if it is possible to read a part of a URL
    > with ActionScript...

    This is the case. :) Read the property MovieClip._url of the main timeline (the
    main scenario is a clip), or the hand LoaderInfo.url property
    the chronology loaderInfo property... If you use ActionScript 3.0.

    for example
    in a scenario main pre-ActionScript 3.0...
    trace (this._url);

    in a main storyline ActionnScript 3.0...
    trace (this.) LoaderInfo.URL);

    That will show you the domain name of the HTML file that contains the
    SWF, you're in, and you can use strings, such as indexOf() methods to see if
    the URL contains ".com", "co.uk" or similar. If you are using ActionScript
    3.0, you can use regular expressions (see the RegExp class).

    David Stiller
    Co-author, Foundation Flash CS3 for designers
    http://tinyurl.com/2k29mj
    "Luck is the residue of good design."

  • I show several problems with extensions does not not after the last CC PS upgraded.

    USM double, for example, as well as several others are not loading any method. No problem before the major CC PS upgrade in June. Remove and reinstall does not work, manual installation discouraged with Panel of Exchange etc.

    I really don't want to track and communicate with each author to see what the problem is that it looks like more systematic

    They are not installable in the application of obsolete Plugin Manager. They show as purchased on the new CC web add Manager, sync is on, but only a handful are in place such as Kuler and AdobeEMailer. Double USM for example is supposed to appear on the filters menu (and not before the release of June), but he isn't.  There is no error log I know for this kind of failure that seems all hidden in the web cloud CC process to add ons and extensions.  What seems to be the addons and extensions start appearing as they upgraded to the new version. This looks like the case with Double USM, which is now available, but has been absent for a month or so after the release in June. So I see how it works as long as the extension developers playing catch up with Adobe, which is inevitable I guess and is something to know if extensions are an integral part of your

    workflow.

  • Set the effect of BitmapImage with actionscript

    Hi all

    I met it in a mobile application that needs to display the icon in IconItemRenderer with a fade effect (0 to 1.0 Alpha). But for me, it is general that the way to set the effect with actionscript? In addition, I'm not sure if the BitmapImage support this.

    Anyone would help show me the codes of configuration effect (not MXML)?

    Kind regards

    Felix

    
    http://ns.adobe.com/mxml/2009"
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="application1_creationCompleteHandler(event)">
         
         
         
              
         
         
              
         
    
    

    This some how work for me.

  • Creating a ComboBox with ActionScript

    I can't create a ComboBox with ActionScript. I want just a simple list, I can add and subtract.

    My Code:

    var inventory: ComboBox = new more.

    Error messages:

    Scene 1, Layer ' Layer 1 ', 1 environment, line 142 1046: Type was not found or is not a constant of compilation: ComboBox. "

    Scene 1, Layer ' Layer 1 ', 1 environment, line 142 1180: call to a method may not set ComboBox. "

    I don't know where I am going wrong. I found several example on the net which was code similar to mine, and some suggested adding the following:

    import fl.controls.ComboBox;

    That didn't work either and gave me more errors. Any suggetions?

    Thanks.

    I should have mentioned to keep this import line.

  • Swap symbol graphic Bitmap dynamically with Actionscript

    I have a graphic symbol that contains a Bitmap, and I would exchange the Bitmap inside the graphic symbol with an external image file when running with actionscript. The graphic symbol is used in interpolation, and I want to dynamically change the image that is used in the interpolation.

    The graphic symbol is part of a MovieClip, so I think I need to use the MovieClip loadMovie method. But, how do you get graphic symbol and so the bitmap inside the graphic symbol.

    Hope I'm making sense here. I tried quitting a little and seems to have an answer for this.

    Thank you!

    You can't use actionscript for refernce a graphic symbol. in particular, you cannot dynamically change anything on a graphic symbol.

    In addition, you cannot dynamically change a Tween with actionscript without breaking the interpolation.

    You can use a movieclip and actionscript to animate anything that you want to animate.

  • Create an image with ActionScript

    How to create an image with ActionScript? The image is at a url that is not guaranteed to be on the same server.

    I prefer something that is compatible with previous versions of Flash player.

    If you could point me to a tutorial or show me how it's done.

    Thank you

    It's suuuuuuuuuuuuper base, you have just a movieclip on the stage and the URL of an image on the internet/local computer

    function loadImage(imageUrl:String,_holder_mc:MovieClip):Void {}
    holder_mc.loadMovie (ImageUrl);
    }

    Fill in the two parameters with the 1. URL of the image and 2. MovieClip that contains the image

    It will load the image in there. Much more in depth tutorials and other things are everywhere, just google it.

    Sam

  • How can I buy tokens to play poker zynga with an ITunes gift card that I download on my ITunes store account. the system on my IPhone gave me the following message "your purchase cannot be completed, to contact Itunes support support a.

    How can I buy tokens to play poker zynga with an ITunes gift card that I download on my ITunes store account. the system on my IPhone gave me the following message "your purchase cannot be completed, to contact Itunes support support on this Web site, www.apple.com/support/itunes/ww/.

    Click here and ask for help from the staff of the iTunes Store.

    (145085)

  • How to play the song with .wma extension

    How to play the song with .wma extension

    If it does not DRM, use VLC. If so, no Mac OS X software can play or convert.

    (142864)

  • I used to reload a page that several times with just a long wait on the F5 key, but now it hard to do 2 refills with even a prolonged pressure on F5?

    In the past, I used to reload a page several times with just one press the F5 key, with pressing long it charge more often, now long or short by pressing the F5 key is sufficient to reload a page or two times

    OK guys, I found the problem, it was because I had MCAFEE Advisor which limited my refreshes, but when I disabled it, everything is back to normal, loool

Maybe you are looking for

  • Cannot switch the language layout with wireless keyboard

    I do a sort of a media center for my mac mini. So far, everything is great, except for one very annoying thing. I bought this wireless keyboard and it's working great, although there is a problem with the layout language switch. When I change the inp

  • Firefox will not base on some sites (Commons) content display

    Hello: On some Web sites (common) Firefox ones do not display options on the site.These sites include Yahoo Mail, Twitter, Weebly. An example would be if there is a menu of choices such that delete, ad, tweet, etc instead of correctly it looks like a

  • Music not purchased from I-Tunes.

    I recently got my first I-Phone 6.  I had some music on my old phone (Blackberry) and my laptop (Dell) that I bought the site of artists.  Is there anyway to put this music on my new phone?  Or I have to buy brand-new via I-tunes?  Thank you!!!

  • FDC error at startup on my 400cs

    Hello can help hereI have a 400cs and I lost my drive AEverything was going well until I tried to install a CD playerThe CD player was not recognized in the bios or back Windows, so I reinstalled windows 95 using diskettesEverything is OK until finis

  • How can you implement a command on a switch Board button in the access to perform a deletion or an append query

    I have a complicated database for packing of products.  I would like to set up a table so that anyone entering may do not mess with my paintings and others.  When I trying to do a command button to run a delete query to clear data and then query adde