Playing Flash animation in FLEX
hi,
i've created 5 animation in adobe flash , want use in flex app. want use 2 buttons, start/stop , pause, every animation. i've tried use flashcomponentplaceholder don't know how control animations. i've allready tried find in google, can't find anything. how use animations in flex app , how control them buttons? there posibillity change animation speed in flex? how disable animations autostart when app loads?
thanks ;]
why don't create simple movie player, that:
<mx:metadata>
[
event(name="complete",type="mx.events.videoevent")]
</mx:metadata>
<mx:script>
<![cdata[
import mx.controls.videodisplay;
import mx.events.metadataevent;
import mx.events.videoevent;
[bindable]
public
public
var video : string;
public function play():void
{
videodisplay.play();
}
public function stop():void
{
if (videodisplay.playing)
videodisplay.stop();
}
public function get playing():boolean
{
return videodisplay.playing;
}
private function playpausebuttonclicked(evt:mouseevent):void {
if (videodisplay.playing) {
videodisplay.pause();
}
else {
videodisplay.play();
}
}
private function stopbuttonclicked(evt:mouseevent):void {
videodisplay.stop();
}
private function stopbubbling(event:event):void
{
if (event.eventphase == eventphase.bubbling_phase)
event.stoppropagation();
}
private
function playheadupdate(evt:videoevent):void {
}
</mx:script>
<mx:canvas width="100%" height="100%">
<mx:videodisplay id="videodisplay" source="{video}" playheadupdate="playheadupdate(event)" width="100%" height="100%"
complete="videocompleted(event);" buffertime="
1"/>
<mx:hbox id="controls" stylename="videocontrolskin" alpha="0.0" click="stopbubbling(event)" visible="false">
<mx:button id="playpausebutton" stylename="videopauseplaybutton" toggle="true" selected="{videodisplay.playing}"
click="playpausebuttonclicked(event)"
/>
<mx:button id="stopbutton" stylename="videostopbutton" click="stopbuttonclicked(event)" />
</mx:hbox>
</mx:canvas>
stick somewhere on canvas , here go.
More discussions in Flex (Read Only)
adobe
Comments
Post a Comment