Copy link to clipboard
Copied
Hi all i'm new to AS3 and i'm making a RNG for a small event i'm going to be hosting. I've run into a small hitch.
My code dictates that a next frame plays on button click. i had a video 12 seconds long play on my 2nd frame. which would then move to third frame for final display of results after the timer ran its course.
This was not an issue until I tried changing the video because of resolution issues
Now the video refuses to play and remains static on the frame... I cannot for the life of me get it to play anymore. I must have screwed something up when changing the video over... or i just got lucky settign up the first one.
Can i get help to get this video to play on Frame2 on the FLV layer automatically when the frame changes to it?
stop();
import flash.events.MouseEvent;
import flash.media.Video;
var myTimer:Timer = new Timer(12000,0);
contestants.restrict = "0-9";
RNG.visible = false;
//Call Button Click
SubmitContestants.addEventListener(MouseEvent.CLICK, generateRandom);
function generateRandom(event:MouseEvent):void
{
//RNG Generator
var maxcontestant:Number = Number(contestants.text);
var RNGresult:Number = Math.floor(Math.random() * (maxcontestant+1));
//RNG Display
RNG.text = RNGresult.toString();
// Visual removal of uneeded displays
SubmitContestants.visible = false;
SubmitContestants.enabled = false;
contestants.height = 0;
contestants.width = 0;
nextFrame();
//Timer function embedded into button click.
//Set to run after 12 seconds
myTimer.start();
myTimer.addEventListener(TimerEvent.TIMER, timerListener);
function timerListener (e:TimerEvent):void
{
//Display RNG result && Move to static Frame for final display
RNG.visible = true;
nextFrame();
}
}
add an appropriately skinned (or not) flvplayback component to frame 2, assign its source and autoplay (and any other parameters you want).
Copy link to clipboard
Copied
what problem are you having with the code you showed, or why are you showing that code?
Copy link to clipboard
Copied
Hey kglad, i have no issue with the code its compiling fine. First time doing this so i provided all the information i can no matter how redundant. Can you assist me with getting a clip to embed in a single frame?
What im aiming for is for the code to switch to the second frame once the button has been pressed then after a delay switch to the third frame. I basically only want that clip to automatically play after the button press for a certain period.
Copy link to clipboard
Copied
add an appropriately skinned (or not) flvplayback component to frame 2, assign its source and autoplay (and any other parameters you want).
Copy link to clipboard
Copied
Fantastic thank you very much. I believe its because i didnt have the file and clip in the same folder too.
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now