A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Graphic Shows until FLV is Loaded

  1. #1
    Junior Member
    Join Date
    Sep 2007
    Posts
    21

    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.

  2. #2
    Senior Member
    Join Date
    Sep 2005
    Location
    Detroit
    Posts
    193
    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

  3. #3
    Junior Member
    Join Date
    Sep 2007
    Posts
    21
    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?

  4. #4
    Senior Member
    Join Date
    Sep 2005
    Location
    Detroit
    Posts
    193
    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

  5. #5
    Junior Member
    Join Date
    Sep 2007
    Posts
    21
    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?

  6. #6
    Senior Member
    Join Date
    Sep 2005
    Location
    Detroit
    Posts
    193
    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

  7. #7
    Junior Member
    Join Date
    Sep 2007
    Posts
    21
    I'm using Flash 8...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center