02-20-2011 03:08 AM
here is my code...
it loads the swf perfectly fine but i cant figure out how to make it play
PLEASE HELP!
var ldr:Loader = new Loader(); var url:String = "Fight2.swf"; var urlReq:URLRequest = new URLRequest(url); ldr.load(urlReq); ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler); addChild(ldr) function completeHandler(event:Event):void { var loadedName:Object=event.currentTarget.content; loadedName.play(); }
02-20-2011 03:16 AM
hey robert,
try this:
function completeHandler(event:Event):void
{
var loadedName:MoveClip = MoveClip(event.currentTarget.content);
addChild(loadedName);
loadedName.play();
}
Im not entirely sure if that will work. but its worth a shot. good luck!
02-20-2011 03:20 AM
Just curious, but what's "Fight2.swf"? ![]()
02-20-2011 03:02 PM - edited 02-20-2011 03:03 PM
thanks for the quick reply!
unfortunately it doesnt seem to be working... it no longer shows the swf or plays it
AND
Fight2.swf is currently a funny playful fight between my friends... im using it as a test before i actually make the swf i want. I want to make sure i can get it to play first haha
02-20-2011 03:41 PM
02-20-2011 03:54 PM - edited 02-20-2011 04:17 PM
If by "fight between my friends" you mean it somehow encapsulates a video (e.g. .flv?) then you should know that the latest simulator (0.9.3) has many audio and video codecs missing (something about licensing issues, in the simulator only, which they are attempting to resolve). Even the browser will not play many of them. You can probably verify if this is your problem by "playing" the video, and watching how long it takes to complete (i.e. fire the completed event). If it completes in the right duration, it's a codec issue...
(Hey, cool... in testing this a bit, I just discovered that the TED videos actually play, with sound! Proof that the basic issue is codecs, and not an inherent problem in the sim as I originally suspected was the problem with audio.)
02-20-2011 05:24 PM - edited 02-20-2011 05:25 PM
Can you attach the Fight2.swf you are trying to play?
Let me verify if it works or not, whether it is compatible with the latest simulator.
02-20-2011 08:28 PM
so i made a basic swf file that simply moves a square into different places... and it works!
so i think ur right in saying it was something with codecs.
O well i think i can still do what i wanted without having it play a movie... thanks for everything guys!
and i hope they solve the codec problems by the time the playbook is released!! haha
02-20-2011 08:30 PM
robertsteven192 wrote:
and i hope they solve the codec problems by the time the playbook is released!! haha
As I mentioned (and the linked post shows), the issue applies only to the simulator, not to the real platform.