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]

Html display order : PDF document in AIR application

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

Hello. I read "The display order of a PDF file operates differently than other display objects in an AIR application. Although PDF content clips correctly according to HTML display order, it will always sit on top of content in the AIR application's[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]

Displaying server stored images in an air application

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

Usually when I go about displaying server stored images in a regular flex application I go about it the following way:- - Create a mysql database table on a server which contains image names - Create a php file which generates all of the image namesf[More]

Bug: Custom AIR Application icons on Mac OS X don't display after install

Category:DefaultRelease time:-0001-11-30Views:130

There are circumstances where custom AIR application icons don't display in certain Finder views after installation. This is apparent when viewing the application in a docked folder popup. The icon renders as a blank with a sort of no entry slash acr[More]

Newbie asks: Will an AIR Application work with CFCs on Standalone PC if ColdFusion is not installed?

Category:DefaultRelease time:-0001-11-30Views:130

I am a ColdFusion developer who is absolutely new to Flex. I would like to create a Flex/AIR application that will run on standalone PCs that are not connected to the Internet. As such, I need to develop a truly standalone application with the entire[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]

Unable to export AIR application in FlashBuilder 4

Category:DefaultRelease time:-0001-11-30Views:130

Hi, I have just finished an AIR application created in Flash Builder 4 / SDK 4.1. But  I have systematically a problem while exporting the application with  the Flash Builder wizard / button Export to a validated version. When I double click on the g[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
I recently updated my iTunes, and something has changed.  I can sync music and audio books - but it erases my ring tones.  I noticed this, and attempted to sync my ring tones -- only to lose all of my music and audio books. I have the "manually manag [More]
Hi there, I'm newbie at SAP PI, I've never seen it before and I'm in a project where the company hired a PI consultant to make it work for SAP GRC x NF-e  (Brazilian fiscal notes). This consultant is showing me what he did here and... I'll need to le [More]
So I upgraded to mavericks and my boot time extended to about 2/3 times the original time can anyone help me? The following is my bootlog. 1/12/13 10:52:11.000 am bootlog[0]: BOOT_TIME 1385866331 0 1/12/13 10:54:31.000 am syslogd[18]: Configuration N [More]
I backed up my old phone to cloud. I can't get the data to transfer to my new phone yelp?Hi CyndiB, Thanks for visiting Apple Support Communities. You may find the steps in this article helpful with restoring a backup to your new iPhone: iOS: Back up [More]
Does anyone know when the Camera Raw plug in that supports the Canon 5D Mark III in Photoshop Elements 10 will be available ? I know release candidate 6.7 is available but only works with Photoshop CS5 - not sure why Adobe chooses to not make it avai [More]
Expresscard 34 e-sata+Snow Leopard+My book...anyone know of a express card that is working in the configuation? Thanks!I just bought my first express card for eSATA and nothing happens when I install it. Hi, If you are looking for an eSATA ExpressCar [More]
Old system: sql2000 with MS Access 2003 adp front end, New(er): system sql2000 with MSAccess 2007 accdb front end I have successfully imported tables, tlks & forms but am unable to import my queries I have tried; Access > Import access database sou [More]
I am trying to upgrade Solaris 10 U6 10/08 to U7 05/09 with live upgrade. But it failed with following errors: # luupgrade -u -n solaris_u7 -s /mnt/cdrom No entry for BE <solaris_u7> in GRUB menu Copying failsafe kernel from media. Uncompressing min [More]
I am currently using Windows XP and am getting the following error message when installing Adobe Reader 9.4: Error 1402. Could Not open Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\OptionalComponents\MSFS. Verify that you hav [More]
I Need help with using find my iPad.  My friend lost her ipad, can she use my iPad to find it and how do we do it. Please help!Unless she had Settings > iCloud > Find My iPad enabled on it then there isn't any way to try and locate it. If she did ha [More]