-
1. Re: How do I make a "poster frame" button on my FLV video in AS3?
kglad Dec 21, 2011 1:48 PM (in response to jl2000)start your video playing in the ide. when you reach the frame you want to use as a poster frame stop your video, right click over the playback component and click export frame.
import that bitmap into flash, convert it to a movieclip and place it over your component. assign its visible property to false when your flv starts.
-
2. Re: How do I make a "poster frame" button on my FLV video in AS3?
jl2000 Dec 21, 2011 2:19 PM (in response to kglad)Thanks for the quick response.
OK - so I have the poster image on layer 1 and video on layer2. (not sure if they should be on the same layer or not.)
so far so good (thank heaven for simple steps).
Now -
How do I "assign its visible property to false when your flv starts." ?
Thanks again
jl
-
3. Re: How do I make a "poster frame" button on my FLV video in AS3?
kglad Dec 21, 2011 2:42 PM (in response to jl2000)if flv_pb is your component name:
flv_pb.addEventListener(VideoEvent.PLAYING_STATE_ENTERED,f);
function f(e:Event):void{
yourconvertedbitmap.visible=false; // use the right name
flv_pb.removeEventListener(VideoEvent.PLAYING_STATE_ENTERED,f);
}
-
4. Re: How do I make a "poster frame" button on my FLV video in AS3?
jl2000 Dec 21, 2011 3:16 PM (in response to kglad)Thanks for the code.
When I used the code with my component (named "vid") and my poster (named "splash6x3") I received the following error.
Scene 1, Layer 'a', Frame 1, Line 17 1119: Access of possibly undefined property PLAYING_STATE_ENTERED through a reference with static type Class. Just to be sure - all elements are one frame one (there is no frame 2) and the component is NOT selected to autoplay.
What else could be missing?
-
5. Re: How do I make a "poster frame" button on my FLV video in AS3?
kglad Dec 21, 2011 4:57 PM (in response to jl2000)copy and paste your code and "bold" line 17.
-
6. Re: How do I make a "poster frame" button on my FLV video in AS3?
jl2000 Dec 22, 2011 6:20 AM (in response to kglad)//if flv_pb is your component name:
import fl.video.VideoEvent;
vid.addEventListener(VideoEvent.PLAYING_STATE_ENTERED,f);
function f(e:Event):void{
splash6x3.visible=false; // use the right name
vid.removeEventListener(VideoEvent.PLAYING_STATE_ENTERED,f);
}
-
7. Re: How do I make a "poster frame" button on my FLV video in AS3?
kglad Dec 22, 2011 6:52 AM (in response to jl2000)the code you're showing wouldn't cause that error and it doesn't seem likely that would be all your code.
-
8. Re: How do I make a "poster frame" button on my FLV video in AS3?
jl2000 Dec 22, 2011 7:08 AM (in response to kglad)I'm sorry if I didn't make it clear that I am totally in the dark about AS3 and have no idea what other code would be used.
I only used the code from your post. I just noticed that I get the identical error for "line 9"....
vid.addEventListener(VideoEvent.PLAYING_STATE_ENTERED,f);
-
9. Re: How do I make a "poster frame" button on my FLV video in AS3?
kglad Dec 22, 2011 11:20 AM (in response to jl2000)start over.
create a new as3 fla. drag an flvpb component from the component panel to your stage and assign its instance name, vid. assign its source.
import your poster bitmap and convert it to a movieclilp and place it on-stage and assign its instance name, splash6x3.
open your actions panel and paste the following and retest:
import fl.video.VideoEvent;
vid.addEventListener(VideoEvent.PLAYING_STATE_ENTERED,f);
function f(e:Event):void{
splash6x3.visible=false; // use the right name
vid.removeEventListener(VideoEvent.PLAYING_STATE_ENTERED,f);
}
-
10. Re: How do I make a "poster frame" button on my FLV video in AS3?
jl2000 Dec 22, 2011 1:42 PM (in response to kglad)Agreed. From the top.
all steps followed yielding the following errors:
Scene 1, Layer 'a', Frame 1, Line 9 1119: Access of possibly undefined property PLAYING_STATE_ENTERED through a reference with static type Class. Scene 1, Layer 'a', Frame 1, Line 3 1119: Access of possibly undefined property PLAYING_STATE_ENTERED through a reference with static type Class. import fl.video.VideoEvent;
vid.addEventListener(VideoEvent.PLAYING_STATE_ENTERED,f); // line3
function f(e:Event):void{
splash6x3.visible=false; // use the right name
vid.removeEventListener(VideoEvent.PLAYING_STATE_ENTERED,f); // line 9
}
-
11. Re: How do I make a "poster frame" button on my FLV video in AS3?
kglad Dec 22, 2011 1:50 PM (in response to jl2000)here, look at this and figure out where you're going wrong:
-
12. Re: How do I make a "poster frame" button on my FLV video in AS3?
jl2000 Dec 22, 2011 2:14 PM (in response to kglad)Thanks for sticking with me.
Errors are gone. What I discovered was that I was putting the AS in it's own layer - not in the vid layer as you did. (also your file is FL5. and mine is 5.5 but I doubt that would matter.)
But clicking on the splash doesn't start the vid. The ONLY thing that starts the vid is to put the fl_pb on autoplay... which bypasses the splash altogether.
I connected your component to my FLV and confirmed this with your file.
-
13. Re: How do I make a "poster frame" button on my FLV video in AS3?
kglad Dec 22, 2011 3:11 PM (in response to jl2000)the layer with the code is irrelevant.
i didn't code for clicking the splash to start the video and neither are you unless you have code you haven't shown.
if you pick a skin that has a start button, clicking that button will start the flv and thereby cause the splash to disappear.
-
14. Re: How do I make a "poster frame" button on my FLV video in AS3?
jl2000 Dec 22, 2011 4:44 PM (in response to kglad)Thanks. I didn't see any difference between the first code you gave me and the code in your fla but it was absolutely flawless.
Thanks again.
-
15. Re: How do I make a "poster frame" button on my FLV video in AS3?
kglad Dec 22, 2011 4:51 PM (in response to jl2000)there is no difference. that's why it didn't make sense to me that you were seeing error messages.
anyway, please mark helpful/correct reponses.



