Using actionscript to make movieclips play at random

Hi,
I have created three layers in Flash all on one frame. One
layer for actionscript and the other two each have a movie clip.
One called Gary_mc the other Paul_mc. I plan to add other movie
clips at a later date.
I want it, so whenever the swf file is loaded a random movie
clip is played. And once that clip is finished another movie clip
is played afterwards again at random.
I have attached my best efforts, however it is still not
working.
Thanks for any help

Hi,
Thanks for replying but this still isn't working. Is it
because all the layers are on the first frame?
Do I but the script in every movieclip?

Similar Messages

  • How do I make a slideshow play in random order?

    I have a simple slideshow comprised of about 10 images that fade in and out from one photo to the next. I'd like to be able to have them play in random order. How can I make this happen?

    You need use JavaScript or jQuery for generate random numbers and use this numbers for navigate in the timeline

  • How can I turn off auto play of an swf/flv using actionscript?

    Does anyone know how to turn off autoplay, using actionscript, of swf/flv?
    I'm trying to showcase four videos on the same page of a website. each video is a generic media player created in flash. when i test the movie, all the videos start playing at once.
    Also, if possible is there a way to have all four videos in the same media player?

    the media player has an autoPlay property.
    and yes, it also has a contentPath property.

  • I DEVELOPED A WEB SITE USING WEB PAGE MAKER WITH A MOUSE OVER TO PLAY A WAVE. WORKS IN IE BUT FF WILL NOT LOAD THE FILE IN HE BACKGROUND. WHEN I FIRST OPEN THE PAGE TO TEST IT WONT PLAY THE .WAV ANY SUGGESTIONS ADD ONS ETC NEEDED THANKS

    I've developed a site using "web Page Make" I put a graphic on a page with a mouse over that morphs the graphic and plays a brief wave. I works with I.E but no go in FF 3.63.I am previewing this off a local networked drive. No problems with other net site with embedded audio do I need a certain add on etc. Can anyone offer some advice. Thanks
    == This happened ==
    Every time Firefox opened
    == I preveiwed the site and try the mouse over feature to excute the wave

    Make sure that you do not use bgsound to pay that music.
    See http://kb.mozillazine.org/Background_music_does_not_play

  • Playing sound using ActionScript 3.0 (newbie)

    I have a Flash animation I've created, and at the last minute we have decided to add one audio track to the background.  The problem is, I have a looping animation in the timeline, so simply inserting the audio into a layer in the timeline will not work (because it will loop as well).
    Can anyone help me with how to insert just one sound file "on top" of all the animations playing using ActionScript 3.0?  I've never worked with the Sound class, and have never put audio into a Flash file besides simply importing it into a frame.
    THANKS!
    Jen

    Worked perfectly.  Thank you thank you!
    Jen

  • How do I disable "up next" on itunes 11 (or at least make it play the next song in my playlist and not some random one)

    ITunes 10 was great and I heard nothing but horror stories about 11 so I didn't upgrade until I got my new computer and pushed my music over.  In fact, I accidentally hit update and disconnected my computer from the Internet to stop it from happening, but was too late and now I'm stuck with it.
    When I play a song and the song ends, instead of playing the next song on the list, it plays some random other song.  When I "clear list," iTunes doesn't play anything at all.  What gives?  What happened to the greatest media player?  As a pro audio engineer, I've got over 150Gb of music and this just doesn't fly.  I HAVE to have my music in order and if iTunes can't do that, what is its purpose?
    Help, please.

    iTunes 11 works fine on my computer...   I think you need to check the "Shuffle" settings in all of your playlists, including the main library...   It sounds like for whatever reason, iTunes is automatically shuffling your playlists...  

  • Screens, like them? hate them? also, how to use actionscript with them.

    So I haven't used a flash version since Flash 8. I've now been given CS4 and inheritid a flash document that uses screens. After 2 weeks of figuring out how the presentation is made to 'go' from slide to slide on keydown, I finally discovered today that it is the default behaviour.
    Ok, so this leads me to my next question. How do people here feel about screens? Like them? Hate them? I feel like I could do half of this stuff easier with actionscript. I feel constrained by this. Not to mention I put some animation into a movie clip and it seems like it's not playing, like it's just poping right to the stop action at the end of that clip.
    Can anyone tell me how to use actionscript with screens? I looked at help, but of course, the help file doesn't give me what I really need to know. I'd like to put my actions on frame one of the root and let that control everything else. But what is the syntax like? The help file recommends external scripts, but that is not an option as the CEO takes this presentation with him and I can't risk having him lose the code.
    Please give me any advice you may have. Thank you!
    Stan

    Not that I'm any kind of expert on this matter, but I've never heard of screens, at least not by that name, and I have been fiddling with Flash for about 9 years now (like this case, I still learn new things all the time... though I'm still clueless as to what they are... chances are I won't miss 'em).
    When you mentioned scenes though, my personal recommendation is along the party lines of avoid them like the plague... use one timeline and/or movieclips for everything.  I have never used them in my own work, and my bias is partly due to having inherited them in other people's work... they make it hard to find things, especially when you have to first discover they're being used to begin with.  From a technical stance, I have found them to be problematic to manage as far as navigation goes.

  • My downloaded TV Shows are played in random order, how do i fix this?

    My downloaded TV Shows are played in random order, how do i fix this?
    Basically I have 10 complete seasons of Friends and I often watch it again and again but at the moment my itunes play my tv shows in random order!
    Please help!

    First, make sure you are running the latest version of iTunes on your computer. Update your Apple TV if you are using this as well.
    Second, if the updates don't resolve it, you'll need to use 'Get Info' on each TV episode. Make sure the media type is 'TV Show'. Then make sure that the epside number and season information is entered properly.
    That should fix your issue.

  • Blur effect using actionscript

    How can I make a blur effect using actionscript, not the
    built-in effect for which I have to use a tween?
    Any codes you can give me or links to tutorials?

    Ok, Using flash help file sI did this:
    import flash.filters.BlurFilter;
    var rect:MovieClip = createRectangle(100, 100, 0x003366,
    "BlurFilterExample");
    var blurX:Number = 30;
    var blurY:Number = 30;
    var quality:Number = 3;
    var filter:BlurFilter = new BlurFilter(blurX, blurY,
    quality);
    var filterArray:Array = new Array();
    filterArray.push(filter);
    mymovie_mx.filters = filterArray;
    It did work, but I have 2 problems with this, one I need it
    to go from 100% blur to 30%blur.
    But my biggest problem is, part of the code I'm using in the
    animation is actionscript 1, and the above solution is actionscript
    2.
    Can anyone give me an actionscript 1 solution?

  • Using Actionscript to create complete scenes

    Ok let me paint a picture. I'm designing an online flash
    application that will dynamically display tutorials stored in a
    MySQL database. These tutorials will be added via a php control
    panel for tutors to add new tutorials to the database.
    So my flash will load, dynamically create a new scene, add in
    some static elements i.e. logo and some other images and then list
    the tutorials for the user to select.
    The user then selects a tutorial and a new scene is
    dynamically created to display the contents of this scene i.e. a
    scrollPane for the text, video component for the video elements and
    the title etc.
    I recently read this tutorial so getting the data from the
    database into Flash shouldn't be a major problem.
    http://www.webmonkey.com/webmonkey/03/40/index1a.html
    Here's what I think I need
    I'm about to start digging through my flash bible so I'll
    edit this and let you know what I've found out myself,
    1. How to create a new scene using Actionscript,
    2. How to add a few images (jpgs) from the library using
    Actionscript,
    3. how to add a scrollPane (all using actionscript),
    4. how to add some text fields,
    5. how to add a video player to access a video from a folder
    on the server and lastly
    6. some kind of back button..
    Majority of these components will be loading content from PHP
    which will access my MySQL server.
    Any help would be greatly appreciated.
    Thanks
    Steve

    A tall order for a single thread! There are many possible
    answers to each question. Plus there are not enough specifics to
    guide you to the correct alternative. The good news it you can do
    what you are planning.
    1. How to create a new scene using Actionscript,
    Do not be confused with the technical feature of a scene in
    Flash IDE. It is not something you use in Actionscript. However
    from a design view, you can create any page oriented content
    application you want. The usually dynamic element for creating a
    page is a MovieClip or the as you mentioned the component
    ScrollPane which is MovieClip.
    Beyond that there are many many ways to go.
    In general you would create one or more template layouts and
    load the content in selecting the template.
    A shell Flash movie would handle the loading of the templates
    and the data or content that would show.
    As well there could be swf that are custom pages that simply
    load and handle all the needed content separately.
    2. How to add a few images (jpgs) from the library using
    Actionscript,
    MovieClip.attachMovie
    You also can load externally using
    MovieClip.loadMovie
    or if you need to manipulate it after loading then
    MovieClipLoad.onLoadInit
    3. how to add a scrollPane (all using actionscript),
    Explained at
    ScrollPane.contentPath">MovieClipLoad.onLoadInit
    4. how to add some text fields,
    The question implies to create the TextField dynamically and
    a central method is:
    MovieClip.createTextField
    5. how to add a video player to access a video from a folder
    on the server and lastly
    Use the FLVPlayback component that is delivered with Flash 8
    Pro. You need to encode the video as FLV format using the video
    encoder that comes with Flash 8 (also possible with import except
    you elected to make it external) or a third party encoder.
    You put the flv files on the server with the swf containing
    the FLVPlayer and use the
    FLVPlayback.contentPath
    method.
    6. some kind of back button..
    Again many many ways to go: You can use the Flash component
    button or create your own. You can make a button from a MovieClip.
    You can do these dynamically or at design time and in either case
    change their functionality and respond to their interactions at
    runtime.

  • Use actionscript to trigger independant sound loop and reset

    Hello guys,
    I have a bit of experience with flash and actionscript, but due to the fact that I don't use it frequently, it happens that I forgot most of what I can do.
    I am about to start a sound project but I wanted to make sure it works before starting research.
    I want to use actionscript to click on letters that will display on the screen, and each letter will trigger an audio loop independantly, hence creating music.I also want to be able to reset the animation, erase all letters and sounds in order to restart. Actually that is the main question
    If it is possible, how ? Would you mind giving me some tips for a "kickstart"

    Is it possible, with flash to put different sounds triggered by a set of a buttons into a track and play this track in a loop ?
    I want to make it so when you press for example buttons A, then B, then C, it will play the sounds A, B and C respectively in an infinite loop. So when you click A, B, C, D, E, it will play ABCDE.
    EDIT: I succeeded ! I had to use arrays to do that. But now I would like that instead of putting the sounds automatically into the array at the beginning (red part), I want to be able to put by clicking on different buttons. It means if I click "A" first it will put the A into index 0, then B and put into index 1, then C and put into index 2, and so on. Also loop it indefinitely. How can ?
    var musicTrack = new Array();
    var aNote:a = new a();
    var bNote:b = new b();
    musicTrack.push(aNote);
    musicTrack.push(bNote);
    musicTrack.push(aNote);
    var musicChannel:SoundChannel;
    var currentSongIndex:int;
    function  onPlayBtnPressed() {
      currentSongIndex = 0;
      playSongFromIndex(currentSongIndex);
    function playSongFromIndex(songIndex:int) {
      musicChannel = musicTrack[songIndex].play();
      musicChannel.addEventListener(Event.SOUND_COMPLETE, songFinished);
      currentSongIndex++;
    function songFinished(e:Event) {
      if (currentSongIndex < musicTrack.length) {
           playSongFromIndex(currentSongIndex);
      } else  {
           currentSongIndex=0;
    onPlayBtnPressed();

  • Do you need to use Actionscript 3 code in Flash player 9 and above?

    Can anyone tell me if I need to use Actionscript 3 code instead of Actionscript 2 code in the following situation:
    I am running a swf file which is contained in a browser window (all files are contained on a CD and I have a 'trust' file set up to let them play properly).  Up until now, I have been using the following Actionscript 2 code to close the browser window (the Actionscript 2 code is on an 'Exit' button within the swf):
    on (release) {
    getURL("javascript:window.close()");
    This Actionscript 2 code has always worked and still works in Flash player 8 and lower.  However, it does nothing when played using Flash player 9.  Can anyone tell me if Flash player 9 won't recognize Actionscript 2 code?  Is it essential to use ONLY Actionscript 3 code if you are using Flash player 9?
    I am having the same problem when I try to launch another html page containing a swf (popped up from the swf contained in the main html window).  I have the following code on the button to launch the popup html window.  It always worked, but suddenly no longer works with Flash player 9.  Here is the code I am using:
    on (release) {
                getURL("javascript:launchWin2('webpage2.html');");
    I have all the necessary background code to launch 'webpage2.html'.  It works everywhere except in Flash player 9.  Can anyone tell me if it is essential to use Actionscript 3 code ONLY on these buttons in Flash player 9?  I am pretty new to Actionscript 3, so any help with syntax would be appreciated. 
    Please note that I don't want to use the projector.
    Thanks!

    You can use both AS2 and AS3 based applications in both Flash 9 and 10.
    As for the issues you describe - perhaps Flash General Forum is a better bet:
    http://forums.adobe.com/community/flash/flash_general

  • Choosing a Song in List View Plays a Random Song Instead with iOS 7.1

    When I'm playing a playlist and try and select a specific song via the "more"? button in the top-right (the icon looks like a three-item bulleted list), instead of playing the song I selected it plays a random song in the playlist. It started doing this after updating my iOS to 7.1. It does not do this if I select the song by going back to the playlist using the arrow button in the top-left. It does not do it when shuffle is turned off, but I never listen to my music without shuffle, so that's not very helpful to me I've tried it with multiple playlists and multiple songs, same result.
    Any thoughts on if this is a setting, or is this a bug?

    Try quitting the Music app and then reset the iPhone like I describe below.
    Double click the Home button to show the screen with running and recently used apps. Each app icon will have a sample page above it. Flick up on the page (not the app icon) and the page will fly away and the app icon will disappear. This quits that app. Then reset your phone. Press and hold the Home and Sleep buttons simultaneously until the Apple logo appears. Let go of the buttons and let the device restart. See if that fixes your problem.

  • DYNAMIC CREATION OF LINE SERIES USING ACTIONSCRIPT

    There's something wierd about flex or im doing something
    wrong?
    - when i create a line series manually using mxml and specify
    a id for the series, it works.
    - similarly when i try to dynamically create a line series
    using actionscript & define an "id" property, flex does not
    understand! what am i doing wrong?
    code for reference:
    private function addSeries(series:Array,
    yField:String,id:String) // addseries(series,"date","1000")
    var ls:LineSeries= new LineSeries();
    var stroke:Stroke = new Stroke()
    ls.yField = yField;
    ls.xField="ts"
    ls.dataProvider=dp
    ls.id=id // tried defining it dynamically, but flex does not
    find
    this.mychart.series.push(ls)
    THIS IS THE ERROR I GET : "TypeError: Error #1010: A term is
    undefined and has no properties."

    I see... I played around with the line chart ...
    Hopefully this helps... if not forgive me...
    I know why you are trying to use the id property which i
    agree doesn't work.
    since the series is an array in your lineChart use the index
    to set the visible property false/true.
    lineChart.series[0].visible = true/false;
    <mx:Lineseries id="a1" visible="true"
    dataProvider="{whatever}" />
    <mx:Lineseries id="a2" visible="false"
    dataProvider="{whatever}"/>
    create a function called init();
    public function init():void
    var lineS1:LineSeries = new LineSeries();
    lineS1.visible = true/false;
    lineChart.series.push(lineS1);
    var lineS2:LineSeries = new LineSeries();
    lineS2.visible = true/false;
    lineChart.series.push(lineS2);
    ... and the key is to call this init function on initialize
    event...NOT on createComplete event
    <mx:LineChart.... initialize="init()" .... />
    and to show both lines... call this function...
    public function showLines():void
    lineChart.series[0].visible = true;
    lineChart.series[1].visible = true;
    Hope this helps....

  • How to load other obejects in flash file after intro using ActionScript 3.0

    How to load other obejects in flash file after intro using ActionScript 3.0 or any other method all in same fla file. see blow intro screen shot ,this one playing repeatedly without loading other fla pages .only way to load other pages is click on Skip intro .see second screeshot below .i need that site to load after intro .
    see codes already in
    stop();
    skipintro_b.addEventListener(MouseEvent.CLICK, skipintro_b_clicked);
    function skipintro_b_clicked(e:MouseEvent):void{
    gotoAndStop("whoweare");
    There is another script there
    /* Simple Timer
    Displays a countdown timer in the Output panel until 30 seconds elapse.
    This code is a good place to start for creating timers for your own purposes.
    Instructions:
    1. To change the number of seconds in the timer, change the value 30 in the first line below to the number of seconds you want.
    var fl_TimerInstance:Timer = new Timer(1000, 30);
    fl_TimerInstance.addEventListener(TimerEvent.TIMER, fl_TimerHandler);
    fl_TimerInstance.start();
    var fl_SecondsElapsed:Number = 1;
    function fl_TimerHandler(event:TimerEvent):void
              trace("Seconds elapsed: " + fl_SecondsElapsed);
              fl_SecondsElapsed++;
    i have no knowledge about these thing ,any help really appreciated .

    Ned Murphy Thank you very Much .It is working .Great advice

Maybe you are looking for

  • My itunes account  had me change my Apple ID to an email address.

    Recently Itunes flagged me for a password reset. When I went to reset the password it told me that I could no longer just use a username that I had to use an email.  So I went through the process, but now I don't see any of my previouse purchased Ite

  • My HP Laptop won't detect my HP Envy 4500

    Hi  I have a HP Laptop that wont detect my printer. When I first got the print about a month ago it set up fine the computer picked it up and everything, but today when I went to print something it wouldnt work, the printer said it was offline but ha

  • IChat doesn't open--period. Bus error?

    I just received my new iMac (Intel Core Duo, woohoo!) on Saturday, and the very first time I tried to open iChat was about an hour ago. All I got was a couple bounces, and then.. failure. Rebooting doesn't make any difference. I tried opening it in T

  • GenericServiceFactory initialization problem when trying to load Web servic

    Hi, I am making a Guided procedure that calls a webservice. I have created a new Destination Template and was able to load the webservice definition successfully, but when I test the callable object I created for that same webservice y get the error:

  • Using additional userprofile attributes from LDAP

    Hi, my users are inside an OpenDS LDAP-Server connected to SSGD 4.41 - all works fine. I would like to store some additional SGD attributes like UserProfile.Multiple = yes/no (Multiple: Whether someone may log in using this user profile and whether t