flash - How to I add button-like behavior to a video player button component? -


background

i'm trying create simple "universal" media player presents same user interface (or similar possible) video , audio playback. unfortunately, flvplayback seems not able handle audio files far can tell, i'm using sound , soundchannel.

my video playback handled using flvplayback component "wired" standard controls on-the-fly when needed. want wire them sound / soundchannel when i'm playing sound same ui widgets work in both cases. i'd avoid building components scratch because flvplayback component lot of nice stuff "for free" it's starting tricky.

gorey stuff

the standard playpausebutton movieclip 2 layers, 1 containing play button (and instance name play_mc) , containing pause button (pause_mc). inside 1 of these movie code this:

stop(); this.uplinkageid = "pausebuttonnormal"; this.overlinkageid = "pausebuttonover"; this.downlinkageid = "pausebuttondown"; this.disabledlinkageid = "pausebuttondisabled"; 

the movie has 2 frames.

on first frame single movieclip instance name placeholder_mc.

on second frame instances of button states, have no instance name (which make things easier). are, however, instances of library object name listed above.

what i'd write function when passed 1 of these buttons (pause_mc, say) adds button-like behavior automagically. bit cannot figure out adobe's "documentation" is, how use information embedded in movie clip code swap contents of placeholder_mc thing want.

tl;dr

in essence need implement function set_instance code below changes button's visible state expected:

var my_button:movieclip = pause_mc; my_button.addeventlistener( mouseevent.mouse_over, function( e:event ){   set_instance( my_button.placeholder_mc, my_button.overlinkageid ); } ); 

i tried working using playpausebutton component today. seems adobe doesn't openly make hooks looking available :p.

the solution came use button ui component , re-skin playpausebutton.

you can dig individual button states out of 2 movie clips (play , pause) contained within playpausebutton component, give them instance names, , use set appropriate skin properties of button using setstyle() method. make sure resize button 23x23 avoid stretching.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -