-
Graphic Shows until FLV is Loaded
Hello,
I was wondering if there was code to add some kind of graphic on the screen of a flv, to be visible until the video starts...then go away when the video plays...just so the viewer doesn't have to look at a black screen while waiting? Let me know.
Thanks.
-
Code:
removeGraphic(e:Event):void{ //remove graphic here
videoPlayer.removeEventListener(VideoEvent.PLAYING_STATE_ENTERED,removeGraphic);
}
videoPlayer.addEventListener(VideoEvent.PLAYING_STATE_ENTERED,removeGraphic);
While the music played you worked by candlelight
Those san francisco nights
You were the best in town
Just by chance you crossed the diamond with the pearl
You turned it on the world
That’s when you turned the world around
-
OK, so where do I place this code? Does it go in a frame, or on the flv itself? And what do I do with the graphic...does that need to be a movie clip in a frame with an instance name? Would the instance name be the removeGraphic? Would the flv have an instance name?
-
All code should be in the main timeline. Make a flvPlayer (wth flvComponent or whatever) named video player. Place the graphic over it. Inside the listener function remove the graphic ( removeChild(yourGraphic); )
While the music played you worked by candlelight
Those san francisco nights
You were the best in town
Just by chance you crossed the diamond with the pearl
You turned it on the world
That’s when you turned the world around
-
Ok,
I put in the flash player with instance "vid"...I created the graphic to play before and gave it instance "image"...I added the code to the top frame:
image(e:Event):void{
vid.removeEventListener(VideoEvent.PLAYING_STATE_E NTERED,image);
}
vid.addEventListener(VideoEvent.PLAYING_STATE_ENTE RED,image);
I'm getting this error message when I publish:
**Error** Scene=Scene 1, layer=Layer 8, frame=1:Line 1: ')' or ',' expected
image(e:Event):void{
Am I not typing something in correctly?
-
What version of flash and Actionscript are you using? This would work in CS3 with actionscript 3
While the music played you worked by candlelight
Those san francisco nights
You were the best in town
Just by chance you crossed the diamond with the pearl
You turned it on the world
That’s when you turned the world around
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|