Log in

View Full Version : Xul + Swf



figipoll
06-03-2008, 02:36 PM
hi, how detect end of *.swf files?
test.xul
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window
title="Test"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="width:750px;height:550px;margin:0px;padding:0px;">
<html:embed
src="test.swf"
width="750"
height="550"
loop="false"
play="true"
swLiveConnect="true"
allowScriptAccess="sameDomain"
/>
</window>

Medyman
06-03-2008, 05:38 PM
What do you mean by the end of the .swf? Is it an animation and you want to know when it's done playing?

Well, you could use the External API to send a javascript command to the page. I don't know if there are any XUL implications here, I haven't ever used XUL.

figipoll
06-05-2008, 11:12 AM
hi,
yes its animation i would like to know how to detect when is done, or duration time.
thx

Medyman
06-05-2008, 12:42 PM
hi,
yes its animation i would like to know how to detect when is done, or duration time.
thx

Right...
Like I said you would need to use the External API to send a javascript call on the last frame of the movie.

If your movie is going to have a static length (i.e. you know the length ahead of time), you can figure out the length by dividing the number of frames in your .fla by the frame rate. But beware that this length will not take into account the loading time.

figipoll
06-05-2008, 03:18 PM
thx for help
i couldnt get to swf file propertes. ifind this and its works

swf=document.getElementById("flashapp");
var a = swf.TGetProperty('/', 5); // max num frames

before i tried just swf.GetProperty -- not in XUL