The following works for me:

FLVPlayback and SeekBar instance on stage.
A button that, when clicked, will toggle the size of the seekbar.

In the button click handler: - resize the seekbar
- set the seekBar property of the video playback to null
- remove the seekbar handle (seekBarHandle_mc) which is otherwise left behind
- reset the seekBar property of the video playback to the same instance as 
before


var SMALL_WIDTH:Number = 100;
var LARGE_WIDTH:Number = 320;

video_fpb.seekBar = video_sb;
video_fpb.contentPath = "paramore_decode_live.flv";

function resizeClickHandler(o:Object):Void {
trace("Application ::: resizeClickHandler");
trace("    - seekbar width: " + video_sb._width);
video_sb._width = (video_sb._width == SMALL_WIDTH) ? LARGE_WIDTH : SMALL_WIDTH;
video_fpb.seekBar = null;
removeMovieClip(seekBarHandle_mc);
video_fpb.seekBar = video_sb;
}

video_sb._width = SMALL_WIDTH;
resize_btn.addEventListener("click", resizeClickHandler);

regards,
Muzak

----- Original Message ----- From: "jonas magnusson" <[email protected]>
To: <[email protected]>
Sent: Tuesday, March 10, 2009 10:39 AM
Subject: [Flashcoders] Re: Changing width of seekBar during playback 
(AS2,FLVPlayback)


Probably solved the seekbar issue.

If anyone happen to have the same problem in the future:

Seems I can get it working by making two seekbars and encapsulating them in
container_mc's.
On "newSize" i set the new size of both seekbars, do remove movieclip on
"prev_container.seekBarHandle_mc" then set "flvplayback.seekBar =
new_container.new_SeekBar".
Then i hide the "prev_container" with _visible=false and make the
"new_container" _visible=true.

The handle is now draggable and i remove the old dead handles, the
left/right limits are updated and the visuals are also updated.

Thanks for listening :)

/Jonas



On Mon, Mar 9, 2009 at 5:55 PM, jonas magnusson <[email protected]>wrote:

Hi List,

I would like to make a FLV player that scales up the width depending on
Stage.width.
The width is different depending on size when starting up, and the user
monitor size when in fullscreen.

I am using the FLVPlayback component AS2.0 (several months of work put in
already).
Video can easily be scaled up, but the seekbar is a big problem.

When i change the width of the seekbar, the flvplayback/seekbar does not
"realize" the new limits of the handle.

Most often the seekBar just takes on a temporary look but then reverts back
after video-end.
So no new left-right limits + temporary graphic change.

Solutions tried:

Placing differently sized seekbars of the same name in different keyframes,
jumping between keyframes (no change at all)

Setting width: "seekBar._width = 300" or "seekBar.progress_mc._width = 300"
(temporary background-only change)

Switching streams after width-change to force update.


Having double seekbars, updating the size of one, then switching between
them (flvplb.seekBar = seekBar2).
Works really well for the new limits, the handle now moves between new
limits. Problem with this solution is that the new handle is not clickable.
Also, there are a lot of "dead handles" from the previous switches. The
"click-area" remains behind the first dead handle.
I managed to remove the graphics of previous handles by
using "handle_mc.removeMovieClip()", but the new handle does not get
assigned the functionality"onPress" -> "startDragging.."


Any and all suggestions appreciated!

/Jonas

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to