Play random frames

I am trying to make the movie play random frames when it is
opened using the following script:
gotoAndStop(random(13)+2);
I managed to do this successfully using numbers in each frame
to see where the movie was but then found that when I added
content(images and movie clips) to the frames a blank screen (that
didn't exist )kept appearing at random intervals and some of the
content in certain frames was missing.
Does anyone know why this is or have an alternative script or
method I can use for the randomisation i need?
p.s I am using Flash 8

You have to wait until a frame is loaded before you can go to
it.
In the first frame:
// wait for all frames to load before jumping to random
this.onEnterFrame = function(){
if(this._framesloaded == this._totalframes){
this.onEnterFrame = undefined;
this.gotoAndStop(random(13)+2);
Alternatively, you could check if a range of frames is
loaded:
this.onEnterFrame = function(){
if(this._framesloaded >= aframenumber){...}
"Dilroy" <[email protected]> wrote in
message
news:e2o0s5$l61$[email protected]..
> I am trying to make the movie play random frames when it
is opened using
the
> following script:
>
> gotoAndStop(random(13)+2);
>
> I managed to do this successfully using numbers in each
frame to see
where the
> movie was but then found that when I added
content(images and movie clips)
to
> the frames a blank screen (that didn't exist )kept
appearing at random
> intervals and some of the content in certain frames was
missing.
>
> Does anyone know why this is or have an alternative
script or method I
can use
> for the randomisation i need?
>
> p.s I am using Flash 8
>
>

Similar Messages

  • Play random predefined set of frames

    hi
    i am pretty new to AS3 so i need a bit of help from you guys. I want to randomize the  results when i press a button, right now i have this code. i have 5 Images. Each is set on a frame where only this image is visible. So i am randomizing the frames when i click on the button. Each time it gives me a random frame number and shows me the image on that frame. Here is the code (made this with a tutorial)
    stop();
    random_btn.addEventListener(MouseEvent.CLICK, choose);
    function choose(event:MouseEvent):void{
              var pic_number : Number = 6;
              var randomFrame:Number = Math.ceil(Math.random() * pic_number);
              trace(randomFrame);
              gotoAndStop(randomFrame);
    Right now i want to do this more advanced, i want to animate in the image. for example i have 5 animations, the first animation goes from frame 2 till 8, the second goes from 9 to 12 and etc, so i got a set of frames (2to8)(9to12) and not like in the previos where i just got one frame. Whats the best way to accomplish it, so pressing the button gives me each time a diffrent animation, it animates from start and then stops. I hope you can help me, thx

    use:
    stop();  // and put stops on each frame where you want the timeline to stop
    var frameA:Array=[1,11,12,13,14,15,16,17];
    shuffle(frameA);
    var index:int=0
    random_btn.addEventListener(MouseEvent.CLICK, choose);
    function choose(event:MouseEvent):void{
              var randomFrame:Number = frameA[index]
              trace(randomFrame);
              gotoAndPlay(randomFrame);
    index=(index+1)%frameA.length;
    function shuffle(a:Array) {
        var p:int;
        var t:*;
        var ivar:int;
        for (ivar = a.length-1; ivar>=0; ivar--) {
            p=Math.floor((ivar+1)*Math.random());
            t = a[ivar];
            a[ivar] = a[p];
            a[p] = t;

  • GPU Acceleration causes random frame in encode?

    New Mac Pro (6 core, d500 cards, 32GB RAM, OSX10.9.4). Adobe Media Encoder CC 2014.0.1. Tested on two separate machines of the same configuration.
    I have a just over 2 hour long 1080p ProRes file that I was encoding to MPEG2 for DVD. During QC of the disc, a random frame from another part of the movie was found in a spot about 39 minutes into the encode. The issue was in the encoded MPEG2 stream.
    The client also wanted a lower resolution h264 proof of the video, and that was encoded on the same machine at a separate time. That had the same random frame at the exact same spot.
    I encoded the preview h264 in just a few minute segment of the video around the glitch on the second Mac Pro. It showed up again. I used the same setting but turned off GPU Acceleration, and the frame is gone.
    Does anyone have any ideas as to what is going on here? Obviously there is a problem with GPU acceleration on the new Mac Pro's with Media Encoder, but what could be specifically causing it and what could be done to fix this? With all of the issues in Premiere and After Effects, some of which are being caused by software updates, and the issues with the one Mac Pro needing to be replaced due to bad video cards, I feel like there is just a ton of problems that didn't exist on our outdated Mac Pro with Final Cut Pro 7.
    Please let me know of any ideas to make me not doubt every encode I do on these machines with GPU Acceleration turned on. Thanks.
    -Phil

    Does anyone have any additional ideas on this? I heard from the CreativeCow forums that this has been a known bug with GPU Acceleration on the new Mac Pros. Is this the case? Has anyone else had this issue looked at by Adobe?

  • AE CS5 (10.0.1.19) Ram Preview - Audio stops and continue playing randomly

    I already reported this issue to Adobe as a BUG but I want to ask here if somebody else have this problem or can confirm it.
    Audio breaks/stops and continue playing randomly when 'Ram Previewing'
    It happens mostly when the RAM is fully filled up with image cache files! When the Ram is not filled up totally with image cache files it happens rarely!
    Steps to reproduce BUG / issue:
    1. create a new composition with a length of for example 5 minutes.
    2. create a new solid with size of 50x50 pixel and animate the position of the solid for a very long time so when ram previewing the whole ram/memory gets filled up with different image cache data (this is very important!). Alternatively you could use a long video file to fill up the RAM completely.
    3. import a wave file .wav 16bit 48khz uncompressed which is very long for example 5 minutes.
    4. insert the wave file in the earlier created composition which contain the animated solid or video file.
    5. Set the work area bar (preview range) for the whole composition.
    'Ram Preview' the composition until the whole RAM/memory is filled up with image data.
    AE has to stop rendering because there is no more space available in RAM.
    make sure 'from current time' checkbox is off.
    6. listen to the audio which stops playing randomly for about 1-2 seconds and comes back and continues playing (***BUG***)
    7. Now set the right handle of the composition work area bar (preview range) to less then the maximum RAM size
    (less then the green cache indicator on the right side)
    8. "Purge image caches" or "Purge All"
    9. Ram preview the now smaller work area
    10. listen to the audio. The audio breaks are gone! (***Workaround***)
    Additional information:
    I have the latest After Effects CS5 update installed (10.0.1.19)
    This behavior is tested with different audio drivers inside After Effects CS5 (After Effects WDM Sound, Generic Low Latency ASIO Driver,  ASIO DirectX Full Duplex Driver)
    I also tried different Sample Sizes Buffers (alternatively to the default 2048 samples) but without success.
    Reducing the amount of RAM which After Effects can access didn't solve the problem!
    System:
    Win7 64bit all latest Updates, 8GB RAM, CPU: intel Core 2 Extreme QX9300, nVidia Quadro FX 2700M, IDT High Definition Audio Driver v6.10.0.6227
    There is no driver problem on my system because After Effects CS3 & CS4, Premiere & Soundbooth CS3 CS4 CS5 have no audio problems!
    I have lots of other professional audio software like Steinberg Cubase 5.... on the same system and they all work fine.
    I also turned off AVG Anitivirus and Windows firewall for testing without success.
    AdobeQT32Server.exe, dynamiclinkmanager.exe, PProHeadless.exe, afterfx.exe do not get blocked by firewall they have full permission.
    The CS5 Production Premium installation went fine and without errors and antivirus protection was turned off for the installation.
    Any help would be nice!
    Felix

    Yep, I agree with craulmedia....
    It's 1 month ago after my initial post and no valuable feedback from Adobe although I filled out the bug report in addition to this post and provide my email for further information.
    The only reason for upgrading from CS4 -> CS5 production suite was the use of all my 8GB RAM in AE and now AE can use it but when it's using it the audio have issues.
    CS5 is on the market for nearly a year and still have such essential issues... And my fear rises there will be no valuable update fixing these issues but instead Adobe forces me to upgrade later this year to CS6 in hope something change...
    I have had support request for different Adobe products in the past including telephone support, web support via Adobe ID... none with success the web support answered my request 3 weeks later with the message they will look into it... time went by and in the end the result was "Yes we know it's a known bug" the bug did not get fixed for that CS version. it even exists in the next major CS release! (talking about EncoreDVD here). Once the web support answered weeks later when I was in holidays and after some days I was not able to respond they closed my case. I reopened the case but never got an answer! Telephone support is nearly waste of time because in 95% of all cases it does not help to reinstall the whole operating system and talking to people who know less about computers in general or Adobe products then my mom - it's a waste of time.
    I don't want to blame here anybody for things happend in the past I just want to point out that this time I choose an other support channel (bug report and forum post) but it seems that this support channel is also a waste of time after 1 month with no valueable feedback!
    I bumped up this post 2 times and thanks to craulmedia for the third time.
    And now here is my fourth time *BUMP*
    All I got so far is: "I saw your bug report it's in the queue"
    Is it still in the queue? which queue nr. does it have? how long will it take to get any answer? is it reproducible? Is it confirmed as a known bug by Adobe? Is Adobe working on a fix? When will this fix be available? Is the fix provided in form of an update or in the next major release?
    OK, I know this is a user to user forum and Adobe people only stop by in their free time and there is no guarantee for any real support.
    But it started out so good in the first time...
    Last 2 things I want to add here:
    1. Why should I provide my email in the bug report? Sure so Adobe can get back to me for further information... but wouldn't it be nice if Adobe would be so kind to give some status report to that given email as a small present for the enthusiastic beta testers ?
    2. please Adobe take a look at www.uservoice.com already Autodesk started to move there with 3ds Max.

  • PLEASE HELP--gotoandPlay plays through frames I dont want it to.

    Hello--I am an architecture student and I am having problems
    with my Flash website. I have uploaded my half-done website on
    http://ilocker.bsu.edu/users/msgoyak/WORLD_SHARED/
    My animations end on frame 311, where I have five buttons
    linking to different frames (The Resume button links to 312 and the
    About Me button links to 313 using
    on (release) {gotoAndPlay(frame number);
    I also have "back" buttons on 312 and 313 which link back to
    311. All three frames have the stop command applied.
    My problem: Whenever I publish and try to click on Resume or
    About Me, it will only play to 312 due to the stop command, thereby
    not allowing me to get to the About Me frame (313). I have tried
    taking away the stop command but then when I click on the About Me
    button the timeline plays through 312 to get to 313 and you can
    actually see it flash through on-screen. I just want ithese buttons
    to jump to their respective frames and stop, without seeing
    anything in-between or stopping where it shouldn't. Is there a
    specific actions script that needs to be applied or would it be
    easier to create new flash documents for each link?
    Hopefully someone can help m after viewing the website
    itself.
    I have version 7 MX 2004.
    Thank you if you can provide any feedback!!!!!! Hopefully
    this frustration thing can be corrected.

A: PLEASE HELP--gotoandPlay plays through frames I dont want it to.

Use the gotoAndStop(frame number): instead of play.
The playhead will stop on the disignated frame, and you won't
need a stop
action on it.
"[email protected]" <[email protected]> wrote
in message
news:f0b17u$5ot$[email protected]..
> Hello--I am an architecture student and I am having
problems with my Flash
> website. I have uploaded my half-done website on
>
http://ilocker.bsu.edu/users/msgoyak/WORLD_SHARED/
>
> My animations end on frame 311, where I have five
buttons linking to
> different
> frames (The Resume button links to 312 and the About Me
button links to
> 313
> using
> on (release) {gotoAndPlay(frame number);
>
> }
> I also have "back" buttons on 312 and 313 which link
back to 311. All
> three
> frames have the stop command applied.
> My problem: Whenever I publish and try to click on
Resume or About Me, it
> will
> only play to 312 due to the stop command, thereby not
allowing me to get
> to the
> About Me frame (313). I have tried taking away the stop
command but then
> when I
> click on the About Me button the timeline plays through
312 to get to 313
> and
> you can actually see it flash through on-screen. I just
want ithese
> buttons to
> jump to their respective frames and stop, without seeing
anything
> in-between or
> stopping where it shouldn't. Is there a specific actions
script that
> needs to
> be applied or would it be easier to create new flash
documents for each
> link?
>
> Hopefully someone can help m after viewing the website
itself.
> I have version 7 MX 2004.
> Thank you if you can provide any feedback!!!!!!
Hopefully this frustration
> thing can be corrected.
>
>

Use the gotoAndStop(frame number): instead of play.
The playhead will stop on the disignated frame, and you won't
need a stop
action on it.
"[email protected]" <[email protected]> wrote
in message
news:f0b17u$5ot$[email protected]..
> Hello--I am an architecture student and I am having
problems with my Flash
> website. I have uploaded my half-done website on
>
http://ilocker.bsu.edu/users/msgoyak/WORLD_SHARED/
>
> My animations end on frame 311, where I have five
buttons linking to
> different
> frames (The Resume button links to 312 and the About Me
button links to
> 313
> using
> on (release) {gotoAndPlay(frame number);
>
> }
> I also have "back" buttons on 312 and 313 which link
back to 311. All
> three
> frames have the stop command applied.
> My problem: Whenever I publish and try to click on
Resume or About Me, it
> will
> only play to 312 due to the stop command, thereby not
allowing me to get
> to the
> About Me frame (313). I have tried taking away the stop
command but then
> when I
> click on the About Me button the timeline plays through
312 to get to 313
> and
> you can actually see it flash through on-screen. I just
want ithese
> buttons to
> jump to their respective frames and stop, without seeing
anything
> in-between or
> stopping where it shouldn't. Is there a specific actions
script that
> needs to
> be applied or would it be easier to create new flash
documents for each
> link?
>
> Hopefully someone can help m after viewing the website
itself.
> I have version 7 MX 2004.
> Thank you if you can provide any feedback!!!!!!
Hopefully this frustration
> thing can be corrected.
>
>

  • Random frames in sequence after render, Premiere Pro Cs6

    I've had this problem a few times before, but I'm going to finally open up about it since this is happening beyond my personal projects and is effecting my corporate work.
    After I do a render of my entire sequence I end up with a frame of a title I created at the start, in all my cross dissolves.
    Here's a video of the problem. I've read of someone having the same problem in the past, but I can't recall how they solved it.
    I really don't understand what the problem is, and it's effecting my work. I've tried clearing my cache, re-rendering, clearing render files, and re-rendering, and all the procedural stuff.

    That worked in removing the opaque title in this specific situation. I'll keep it in mind for the next time I need a solid background color. Thank you.
    But how would you go about trying to resolve a random frame in the middle of a clip? The frame is of a shot earlier in the sequence, and it has no reason to randomly appear in the middle of a rendered clip. No transitions, just hard cut and placed together clips.
    I'd post screenshots of that situation, but I had already tore apart the sequence and re-rendered it to make it work.
    For whatever reason, out of the blue, when I render footage a random frame from the sequence will occasionally embed itself in the video preview files that were just rendered in the sequence.
    As for this project. I exported this corporate shoot, and the slightly opaque titles weren't in the cross dissolves, thankfully. The client was happy, but I was still confused as to why my rendered video previews would contain random frames of the sequence. For just a frame.

  • Selecting a random frame in another scene

    I have an app I'm creating with Flash CS5.5 with 42 different short stories in it.  It has 2 scenes.  Scene 1 is the opening and contents menu to access the stories.  Scene 2 contains the 42 stories.
    In scene one, I have a button that I want to be able to pick a random story so it would need to pick a random frame between 1 and 42 in scene 2.  I have seen some code in here that will pick a random frame when you open the program, but I don't know how to tie it to a button or pick a random frame in another scene.  Any ideas on how this is done?
    Thanks!

    I don't understand why, but it's not working properly for some reason.  I have only one scene now and the 42 stories ended up being in frames 88-139.  When I click the random button the first time, it seems to work ok.  It sometimes works a 2nd or 3rd time, but it eventually gets to the last story and it won't do anything after that.  I think it's going past the last frame of the timeline so the buttons no longer work after that.
    There is a randomizing button on every frame except for frame 1.
    This is the code I'm using for it with the first randomizing button located on frame 2:
    Random02.addEventListener(MouseEvent.CLICK, gotoF02);
    function gotoF02(e:Event):void{
    this.gotoAndStop(88+Math.floor(this.scenes[0].numFrames*Math.random()), this.scenes[0].name)
    After frame 2, the button changes to Random03, 04, etc. and the function changes to gotoF03, 04, etc.
    Any ideas of what is going wrong?
    Thanks!

  • Loading Movie to Random Frame

    I am having trouble with my script(AS3) that loads a random
    frame when the movie starts. On frame 1 I have a preloader that
    takes you to frame 2. On frame 2, I have an Array that is suppose
    to choose from 2 frames randomly to start the movie. Well, it works
    fine with 3 frame numbers in my array, but with 2, it always starts
    on the the first frame number in the array.
    Here is the code:

    Change the last line on your frame 2 script.
    TS

  • How to cut random frames in a video file

    Hi,
    I want to know how we can cut random frames in a video file using JMF? Please help!
    thanks in advance.

    Thanks for the answer, Is there any other way to do this using som plugins ot tools?

  • Pandora starts playing randomly while I am on the net or watching a movie. How do I fix this problem? Thanks.

    Pandora starts playing randomly while I am on the net or while watching a movie. How do I fix this problem? Thanks.

    Double click the home button and swipe the mini Pandora up to make sure it's closed. If it still keeps playing randomly delete and reinstall the Pandora app.

  • How to play random MOH files on UC320W?

    Hi,
    Is it possible to configure the UC320W MOH (from external device) to play random music files?
    Regards

    If you are using the input jack for MOH, the UC320 will stream whatever audio is playing on the external device.  MP3 player connected the jack set to random should do what you are looking for.

  • 6th generation with voice over turned off, still plays random song names and lists 45 min into a run

    6th generation with voice over turned off still plays random song names and playlist 45 min into a run. How can I fix this.

    Sweat is getting into your buttons and causing spoken menus to come on. Run with your ipod placed somewhere that gets less exposed to your sweat.
    i

  • Premiere Pro CS3 Issue- Cross Dissolve Transition creates random frame insert

    Hello,
    I have had this issue for a long time, and whenever I render a cross dissolve transition, once in a while, it inserts a random frame from either the prior or latter clips that I apply the transition effect to.
    I don't know how to solve this issue and could use help as soon as possible.
    Thank you,
    Th3On3Fr33man

    I agree with Harm.
    This happens when one does not have enough Frames (Handles), beyond the Out-Point, or before the In-Point, to accommodate the Duration of the Transition.
    For some more info on Handles, these might be useful:
    In the days of A-B Roll editing, or with film, Handles were an easy concept to grasp. With current NLE's, it's more abstract.
    Good luck, and do not forget to read through the Help files. In the days of manuals, this concept was covered pretty well. Curt Wrigley covers it in his Classroom in a Book PrPro.
    Hunt

  • Final Cut pro doesn't play the frames

    My final cut pro doesn't play the frames in the application.
    The whole time it works great but at ones this happend.

    Couple of things to check and try.
    1) In Viewer Display options check to see whether Better Performance is checked in the Quality section. If not, check it and that should help you set real time playback with a slight reduction in quality in the Viewer. However, it will not have any affect on your project.
    2) If that doesn't work, consider generating Proxy files by eight clicking clips >Transcode Media. There is also a setting in Viewer Display Options to use Proxy in editing your project. Before you export the finished project, remember to change that setting  back to Original/Optimized.
    3) If that doesn't work, download a speed test and check the throughput of your media drive. It should be a separate drive from your start up disk and should be connected by Thunderbolt (fastest) USN3 (next fastest) or Firewire 800.
    Russ

  • FCP adding random frames to my exports

    so here's my problem
    i exported my sequence using "export with current settings"
    but when i do i look at the export and there are suddenly random frames thrown into the cut
    i thought, 'man i must have not watched the cut before i exported'
    so i went back and looked at it, it looked fine, those frames are NOT in my sequence
    to absolutly make sure i went to the same part in the sequence where the added frame was on my export and went frame by frame to make sure
    there aren't any random frames in the sequence only the export
    i have tried exporting through QT conversion too and it still added those random frames
    why can't i export without those frames?
    i'm working in FCP 6.0
    Message was edited by: dreadheadhb

    alright what the heck is going on???
    i'm really starting to hate FCP 6 !!!!!!!
    so i opened my original scratch media in QT and exported then deleted the old file that was giving me trouble
    then when i open my project, fcp is asking me to reconnect
    so i choose the new file and it won't let me connect!!!!!!!!
    http://img2.freeimagehosting.net/uploads/f1d9dbc665.png
    it won't let me connect!!!
    Message was edited by: dreadheadhb
    Message was edited by: dreadheadhb

  • Maybe you are looking for