Skip to main content
Participating Frequently
November 11, 2012
Answered

using cue points to change a text box

  • November 11, 2012
  • 1 reply
  • 1073 views

Ok I asked a simlar question before but I am still having trouble getting it to work.

I have a video with 11 Cue points and at each cuepint I want the Typebox to change it text at each cue point.

When the video is playing I want a the textbox to change the text when cue point 1 is reached. This is the code I am using. But every always goes straight to the whatever the last functions text and skips all the other before it. Its bassically this code repeated with difffernt function name and string.

import fl.video.MetadataEvent;

flvplayer.addEventListener(MetadataEvent.CUE_POINT,section2Cue);

function section2Cue(event:MetadataEvent):void{

    for(var String = "section2" in event.info){

        typebox.text = "Hello";                        }

}

So basically I want to tell flash, when CuePoint1 is reached text = "hello world" and when CuePoint2 is reached I want the text ="Hello Again". I don't know what I am doing wrong or what is the best way to tell flash how to do this

This topic has been closed for replies.
Correct answer kglad

you should have only one cuepoint listener and one listener function:

import fl.video.MetadataEvent;

flvplayer.addEventListener(MetadataEvent.CUE_POINT,section2Cue);

function section2Cue(event:MetadataEvent):void{

        typebox.text = event.info.name;    // it's not clear what property of your cuepoint your want to display but this is a start.  if it's not what you want, show your cuepoint data.

}

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
November 12, 2012

you should have only one cuepoint listener and one listener function:

import fl.video.MetadataEvent;

flvplayer.addEventListener(MetadataEvent.CUE_POINT,section2Cue);

function section2Cue(event:MetadataEvent):void{

        typebox.text = event.info.name;    // it's not clear what property of your cuepoint your want to display but this is a start.  if it's not what you want, show your cuepoint data.

}

vekzeroAuthor
Participating Frequently
November 12, 2012

Ok, I tryed that code Basically I want to call upon each cue point individually and have an event for each one. So how i tell it to display this only when Cuepoint1 is reach and display that only when Cuepoint2 is reached.  What data would help ?

Most of my code is just buttons to reach each cuepoint within the video. I got that to work fine.

I'll supply it anyways

import flash.events.MouseEvent;

// Assign a new skin to my FLVPlayback instance using ActionScript

flvplayer.skin = "player.swf";

flvplayer.fullScreenTakeOver = false;

//select section menu button

selectBtn.addEventListener(MouseEvent.CLICK, openMenu);

          function openMenu(event:MouseEvent): void{

                    trace("working");

                    selectMenu.gotoAndPlay(2);

 

                    }

 

 

          selectMenu.closeX.addEventListener(MouseEvent.CLICK, closeMenu);

 

                    function closeMenu(event:MouseEvent): void{

 

                              trace("closing");

                              selectMenu.gotoAndPlay(11);

                    }

 

 

 

          //Cuepoint Buttons

selectMenu.sec1.addEventListener(MouseEvent.CLICK, section1Button);

function section1Button(event:MouseEvent):void

{

          // Replace video_instance_name with the instance name of the video component.

          // Replace "Cue Point 1" with the name of the cue point to seek to.

          var cuePointInstance:Object = flvplayer.findCuePoint("section1");

           flvplayer.seek(cuePointInstance.time);

           typebox.text = "Orion Health EMR Lite Overview";

}

 

selectMenu.sec2.addEventListener(MouseEvent.CLICK, section2Button);

function section2Button(event:MouseEvent):void

{

          // Replace video_instance_name with the instance name of the video component.

          // Replace "Cue Point 1" with the name of the cue point to seek to.

          var cuePointInstance:Object = flvplayer.findCuePoint("section2");

           flvplayer.seek(cuePointInstance.time);

           typebox.text = "Adopt Electrionic Patients Records Easily";

}

 

          selectMenu.sec3.addEventListener(MouseEvent.CLICK, section3Button);

function section3Button(event:MouseEvent):void

{

          // Replace video_instance_name with the instance name of the video component.

          // Replace "Cue Point 1" with the name of the cue point to seek to.

          var cuePointInstance:Object = flvplayer.findCuePoint("section3");

           flvplayer.seek(cuePointInstance.time);

          

           typebox.text = "Introducing Orion Health EMR Lite";

}

 

                    selectMenu.sec4.addEventListener(MouseEvent.CLICK, section4Button);

function section4Button(event:MouseEvent):void

{

          // Replace video_instance_name with the instance name of the video component.

          // Replace "Cue Point 1" with the name of the cue point to seek to.

          var cuePointInstance:Object = flvplayer.findCuePoint("section4");

           flvplayer.seek(cuePointInstance.time);

          

           typebox.text = "Meet Mr. Smith - Patient Registration and Intake";

}

selectMenu.sec5.addEventListener(MouseEvent.CLICK, section5Button);

function section5Button(event:MouseEvent):void

{

          // Replace video_instance_name with the instance name of the video component.

          // Replace "Cue Point 1" with the name of the cue point to seek to.

          var cuePointInstance:Object = flvplayer.findCuePoint("section5");

           flvplayer.seek(cuePointInstance.time);

          

           typebox.text = "Orion Health EMR Lite in the Exam Room - Clicnical Documentation and Orion Health HIE Integration";

}

selectMenu.sec6.addEventListener(MouseEvent.CLICK, section6Button);

function section6Button(event:MouseEvent):void

{

          // Replace video_instance_name with the instance name of the video component.

          // Replace "Cue Point 1" with the name of the cue point to seek to.

          var cuePointInstance:Object = flvplayer.findCuePoint("section6");

           flvplayer.seek(cuePointInstance.time);

          

           typebox.text = "Working with Orion Health EMR Lite - Documentation";

}

selectMenu.sec7.addEventListener(MouseEvent.CLICK, section7Button);

function section7Button(event:MouseEvent):void

{

          // Replace video_instance_name with the instance name of the video component.

          // Replace "Cue Point 1" with the name of the cue point to seek to.

          var cuePointInstance:Object = flvplayer.findCuePoint("section7");

           flvplayer.seek(cuePointInstance.time);

          

           typebox.text = "Order Entry in Orion Health EMR Lite";

}

selectMenu.sec8.addEventListener(MouseEvent.CLICK, section8Button);

function section8Button(event:MouseEvent):void

{

          // Replace video_instance_name with the instance name of the video component.

          // Replace "Cue Point 1" with the name of the cue point to seek to.

          var cuePointInstance:Object = flvplayer.findCuePoint("section8");

           flvplayer.seek(cuePointInstance.time);

          

           typebox.text = "ePrescribing";

}

selectMenu.sec9.addEventListener(MouseEvent.CLICK, section9Button);

function section9Button(event:MouseEvent):void

{

          // Replace video_instance_name with the instance name of the video component.

          // Replace "Cue Point 1" with the name of the cue point to seek to.

          var cuePointInstance:Object = flvplayer.findCuePoint("section9");

           flvplayer.seek(cuePointInstance.time);

          

           typebox.text = "ePrescribing";

}

selectMenu.sec10.addEventListener(MouseEvent.CLICK, section10Button);

function section10Button(event:MouseEvent):void

{

          // Replace video_instance_name with the instance name of the video component.

          // Replace "Cue Point 1" with the name of the cue point to seek to.

          var cuePointInstance:Object = flvplayer.findCuePoint("section10");

           flvplayer.seek(cuePointInstance.time);

          

           typebox.text = "Quality and Utilization Reporting";

}

selectMenu.sec11.addEventListener(MouseEvent.CLICK, section11Button);

function section11Button(event:MouseEvent):void

{

          // Replace video_instance_name with the instance name of the video component.

          // Replace "Cue Point 1" with the name of the cue point to seek to.

          var cuePointInstance:Object = flvplayer.findCuePoint("section11");

           flvplayer.seek(cuePointInstance.time);

          

           typebox.text = "Summary";

}

As for data? This is all I know about my CuePoints

Would the best way to acheive changing type is to change the way my movie clips are set up? Instead of telling it within the actionscript maybe telling it to go to next frame within a movieclip with the content? I don't know exactly how to word what I am trying to acheive but I'm trying!

thanks!

kglad
Community Expert
Community Expert
November 12, 2012

your cuepoints should have the property (text) that you want to display.