Sitemap

Amicuk Programming Answers

Display image in standalone AIR application

2015-10-11   Views:1

Advertisement

I have loaded images and like to display image in standalone AIR application. But I cannot get it work. The code as follows: private function ImageLoader(url:String):void var request:URLRequest = new URLRequest(url); var loader:Loader = new Loader();

I have loaded images and like to display image in standalone AIR application. But I cannot get it work. The code as follows:
private function ImageLoader(url:String):void
var request:URLRequest = new URLRequest(url);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderComplete);
loader.load(request);    
private function loaderComplete(event:Event):void
var scaleFactor:Number = 1;
var uic:UIComponent = new UIComponent();
try
var bmp:Bitmap = event.target.content as Bitmap;
var bmd:BitmapData = bmp.bitmapData; //Bitmap(event.target.content).bitmapData;
var scaledBMD:BitmapData = new BitmapData(400, 400);
var matrix:Matrix = new Matrix();
matrix.scale(scaleFactor, scaleFactor);
scaledBMD.draw(bmd, matrix, null, null, null, true);
uic.x = 40;
uic.y = 40;
uic.addChild(new Bitmap(scaledBMD));
catch (errObject:Error)
trace(errObject.message);

The replay answer
Advertisement
Found answer by adding mx:Canvas and add
iconCanvas.addChild(uic);
after
uic.addChild(new Bitmap(scaledBMD));
<mx:Canvas id="iconCanvas" width="10" height="10" horizontalScrollPolicy="off" verticalScrollPolicy="off" x="0" y="0" clipContent="false"/>
Is anyone create "Canvas" by using new Canvas and get it works? example:
var canv:Canvas = new Canvas(...);

Go to See the other 2 answers

Display image in standalone AIR application

Category:DefaultRelease time:2015-10-11Views:130

I have loaded images and like to display image in standalone AIR application. But I cannot get it work. The code as follows: private function ImageLoader(url:String):void var request:URLRequest = new URLRequest(url); var loader:Loader = new Loader();[More]

Incorrect functionality of Embedded tag in html page, displaying object on top of all layers of Adobe air application native window

Category:DefaultRelease time:2015-10-11Views:130

Title Incorrect functionality of embed tag in html loader for adobe air development Description Problem Description: If we had loaded youtube.com video url in a view stack and navigate to other index of stack or away from we UI screen within the same[More]

Opening a PDF in Acrobat via an AIR application

Category:DefaultRelease time:2015-10-11Views:130

Hey, I'm creating my first AIR application. The application needs to be able to launch Acrobat to view a PDF file. I have done a lot of searching and can't seem to find anything, could someone point me in the right direction? I read a response here:[More]

Packaging an AIR application in a native installer

Category:DefaultRelease time:2015-10-11Views:130

Hi! I'm trying to create a native installer of my AIR Application,  because (I think) it's the only way make the native processes working.  But I have a problem: I used the following command to pack: "adt  -package -storetype pkcs12 -keystore myCert.[More]

Problem with Expose and Adobe AIR application -can't click on app in Expose

Category:DefaultRelease time:2015-10-11Views:130

I just installed a new Adobe AIR application called TwitterLocal. The app was working fine until I accidently hit some keyboard shortcut and the application window disappeared. I figured I accidently assigned the window to some other "space," ho[More]

FLV Playback and Seekbar on different native windows in one Air application

Category:DefaultRelease time:2015-10-11Views:130

Hello Everyone.  I'm trying to make a simple video playback AIR application that utilizes the initial native window to house a transport control with a seekbar on it.  Once the application launches, it creates a second (new) window on my second scree[More]

Hot
Was wondering if there is a way to work on two papers at the same time.  I'm new to apple and pages.  Windows allows you to drag the paper to the left or right and it automatic makes the necessary room.  Is there a way to do the same thing?Harold, I [More]
Boa tarde, Caros colegas, tenho um problema na transferência entre centros com substituição tributária MM/SD (tipo de movimento 862/861) em um cliente de Retail, gostaria de saber se alguém já teve que fazer esse tipo de contabilização. Abaixo segue [More]
I have a VI which I want to build into a .exe which will be used as an HMI for a real-time system. I am using the SMTP VIs to text/email me various notifications about the system state. The main VI works fine if run but will not build into an .exe. T [More]
Hello, I am using Oracle 10g with APEX 2.0. Here is my question: I have a report and I am using 3 text fields and a select list to search through a join of two tables. The select list is composed of a "list of values" and the parameter, which is [More]
Every time I sync my iPhone to iTunes, it messes up my music and I spend 6 hours trying to fix my library and getting my playlists back and getting my songs accessible on both the iPhone and iTunes once again. This is a bit ridiculous. I thought a si [More]
I recently had my computer serviced by the Geek squad for virus removal, I tried to use itunes and connect my ipod and I keep getting this message by: itunesHelper.exe- unable to locate component. "This application has failed to start because QTFC.dl [More]
how to take confirmation of balance for vendor account tell me the path and proceeduresHi, T.Code for Balance Confirmation of Vendors : F.18 and for Vendors F.17. Before that you have to make some configurations for assigning the relative Corresponde [More]
Greetings, I have an InfoPath 2013 form that uses an external data connection.  The data connection became corrupt (somehow, no one knows who changed what).  A user went in to InfoPath designer and created a new data connection and changed all refere [More]
Hi, We are using RDC methodology for launching the crystal reports in the web using ASP. The web server operating system is Windows 2003, Crystal Reports XI is installed in it.  Report is not launching in only one client machine.  For all the other c [More]
Our users are normally not allowed to install any programs since their user accounts do not have administrative rights to their pc's. Has this been a feature in FireFox before? We noticed that one user was able to simply download firefox, run the ins [More]