Posts Tagged ‘ load ’

Loading Image / Swf in MAC, AIR

A Quick tip, was stuck today to load an local image / swf inside AIR at MAC OS.
The below is the solution:

var filenotion:String =”;
if(Capabilities.os.search(“Mac”) >= 0) filenotion = “file://”;
Image.source= filenotion +imgFileURI;

Advertisements

fileReference.load()

Today, i faced a weird problem of fileReference.load() not working in AIR. Even, in the latest 3.3 SDK. To resolve that, you have to install Flex Builder Update. Then, modify your App.xml into air version 1.5. As, to get the benefits of latest AIR Version.

Otherwise, in AIR: Code gets compiled but when we select a file from system, it throws a error.

Preview Image Loader

Loading Image from local file system using the power of  Flash Player 10, Filereference.load()
Check the Demo the link contains the source file.

AVM1Movie Controller in Flex

Overcome restrictions on an AVM1 SWF file loaded by an AVM2 SWF file:

While trying to control AVM1Movie (Flash Player 8, 9, 10 or older) from flex, we will get the below error message: “Property stop not found on flash.display.AVM1Movie and there is no default value. ”

To overcome this problem, ForcibleLoader class converts them into latest player versions on runtime. The below is an working example for how to control AVM1Movie from Flex.

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml&#8221; layout=”absolute” initialize=”init()”>
<mx:Script>
<![CDATA[
private var swfURL:String = “AVM1Movie.swf”;
private var libMC:MovieClip = new MovieClip();
private function init():void{
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfComplete);
var fLoader:ForcibleLoader = new ForcibleLoader(loader);
fLoader.load(new URLRequest(swfURL));
swfContainer.addChild(loader);
}
private function swfComplete(event:Event):void{
libMC = event.currentTarget.content as MovieClip;
libMC.gotoAndStop(1);
}
]]>
</mx:Script>
<mx:UIComponent id=”swfContainer”/>
<mx:NumericStepper id=”slide” change=”{libMC.gotoAndStop(slide.value)}”/>
</mx:Application>