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
New Developer
mertreload
Posts: 56
Registered: ‎03-31-2011
My Device: Soon PlayBook
Accepted Solution

Flash project in flex

Hello, I have a program that is written on flash, can I just export it and put the .swf in Flex? 

 

Will BB accept it?

 

-Thanks

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

Re: Flash project in flex

Flex is Flash API for the web.  The PlayBook uses AIR (Flash for the desktop).  How was the original flash application created?  You can load a SWF into an AIR (or Flex) application.

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

Re: Flash project in flex

BB does not really care how the final AIR application was created, as long as it meets it's criteria that includes AIR loading, signing, icons, etc.

New Developer
mertreload
Posts: 56
Registered: ‎03-31-2011
My Device: Soon PlayBook

Re: Flash project in flex

Thank you

New Developer
mertreload
Posts: 56
Registered: ‎03-31-2011
My Device: Soon PlayBook

Re: Flash project in flex

Oh, forgot to ask something.

 

How to add images as variables then call them by addChild?

 

 

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

Re: Flash project in flex

Like:

 

private var myimage : Image = new Image();


...



this.addChild( this.myimage );

 

??

New Developer
mertreload
Posts: 56
Registered: ‎03-31-2011
My Device: Soon PlayBook

Re: Flash project in flex

Yep, thanks but how to assign a IMAGE to that var? Didn't understand, sorry I'm a rookie :smileyvery-happy:

 

For an example I have an image in my src folder, the folder that the mxml is in. 

 

The image's name is image.png

 

How do I assign it to a var?

 

And I dont want it to be shown before I give the addChild cmd.

 

Thanks

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

Re: Flash project in flex

Depends on the image.  If it is small for things like buttons, I would embed it.  If it is larger and might get swapped with another image during runtime, I would load it dynamically.  Look at the QNX Image API for setting the image.  URLLoader to load resources (found on Adobe FLEX/AIR website).

New Developer
mertreload
Posts: 56
Registered: ‎03-31-2011
My Device: Soon PlayBook

Re: Flash project in flex

Hmm, what I want is small 100x30 clouds. 

 

Can you post a sample code?

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

Re: Flash project in flex

I would embed those.  If it is the same image but in muliple places, then you just need to embed once.

 

[Embed(source="assets/cloud.png")] private var cloud_resource:Class;

 

Then on

 

this.myimage.setImage( new cloud_resource() );