Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Help autoplay video on nextframe, AS3 Noob

New Here ,
May 26, 2018 May 26, 2018

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?

AS3help.jpg

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();

}

}

TOPICS
ActionScript
512
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 28, 2018 May 28, 2018

add an appropriately skinned (or not) flvplayback component to frame 2, assign its source and autoplay (and any other parameters you want).

Translate
Community Expert ,
May 27, 2018 May 27, 2018

what problem are you having with the code you showed, or why are you showing that code?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 28, 2018 May 28, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 28, 2018 May 28, 2018

add an appropriately skinned (or not) flvplayback component to frame 2, assign its source and autoplay (and any other parameters you want).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 29, 2018 May 29, 2018

Fantastic thank you very much. I believe its because i didnt have the file and clip in the same folder too.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 29, 2018 May 29, 2018
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines