Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Regular Contributor
robertsteven192
Posts: 50
Registered: ‎02-20-2011
My Device: Playbook (sim)

Playbook app loads swf file... but will not play!

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();
		
		}

 

 

 

My PlayBook Apps -------- My Apps
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Playbook app loads swf file... but will not play!

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!

 

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Developer
UberschallSamsara
Posts: 1,029
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: Playbook app loads swf file... but will not play!

Just curious, but what's "Fight2.swf"?  :smileywink:

Regular Contributor
robertsteven192
Posts: 50
Registered: ‎02-20-2011
My Device: Playbook (sim)

Re: Playbook app loads swf file... but will not play!

[ Edited ]

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

My PlayBook Apps -------- My Apps
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Playbook app loads swf file... but will not play!

Can you recompile the source with the 0.9.3 SDK?

 

Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Playbook app loads swf file... but will not play!

[ Edited ]

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.)


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
AppStoreLover
Posts: 297
Registered: ‎10-30-2010
My Device: PlayBook

Re: Playbook app loads swf file... but will not play!

[ Edited ]

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.

Regular Contributor
robertsteven192
Posts: 50
Registered: ‎02-20-2011
My Device: Playbook (sim)

Re: Playbook app loads swf file... but will not play!

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

My PlayBook Apps -------- My Apps
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Playbook app loads swf file... but will not play!

 


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.

 


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!