PDA

View Full Version : videoDisplay source changing


eddjc
08-30-2009, 03:26 PM
Hey,

I want to be able to change the source of an element from an Actionscript-based extension of videoDisplay - I have two variables low and high and when I click on a toggle button it should swap the two videos - I'm doing it this way right now:
public var low:String;
public var high:String;


private function hd_onClick(event:MouseEvent):void {
(hdPressed) ? hdPressed = false : hdPressed = true;
(hdPressed) ? source = high : source = low;

}

(low and high defined in the MXML file.)

these both are declared in this class definition:

public class ECVid extends VideoDisplay

Nothing appears to be happening when I click on the button (although the icon does change as I mean it to do). I stupidly haven't done a breakpoint debug - will do after I've written this (debug flash player not installed and will have to quit browser!). I'm guessing that some other function needs to be called to make the video reload - any ideas?

Many thanks
Edd

eddjc
08-30-2009, 06:38 PM
ah worked this out! (As often I do very quickly after I've posted!) - just need to stop(); and play(); and bob's you're uncle...

Many thanks
Edd:-)