Copy link to clipboard
Copied
I try this code its working in computer but when I publish this file in .apk or .ipa , my external swf file is not opening
(I include my external file as well)
places_btn.addEventListener(MouseEvent.MOUSE_DOWN, newvid);
function newvid(event:MouseEvent) {
trace("you clicked me");
var loadit = new Loader();
addChild(loadit);
loadit.load(new URLRequest("scene02.swf"));
}
add this in your newid function:
You forgot to put the beginning of your original function in it:
var loadit = new Loader();
addChild(loadit);
var _lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
loadit.load(new URLRequest("scene02.swf"), _lc);
Copy link to clipboard
Copied
add this in your newid function:
var _lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
loadit.load(new URLRequest("scene02.swf"), _lc);
details about why you should provide a loader context here
Copy link to clipboard
Copied
If you try to load AIR App from CD - in some cases Air can't find file using Loader. Use File class instead and only than using Loader use loadBytes. I made presentation that works prefectly locally. But when I put it on CD - it's can't find any SWF so only one solution was it's use File class.
Copy link to clipboard
Copied
then what well be the code??
Copy link to clipboard
Copied
places_btn.addEventListener(MouseEvent.MOUSE_DOWN, newvid);
function newvid(event:MouseEvent) {
trace("you clicked me");
var _lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
loadit.load(new URLRequest("scene02.swf"), _lc);
}
i try this but got this error
"access of undefined property loadit"
Copy link to clipboard
Copied
add this in your newid function:
You forgot to put the beginning of your original function in it:
var loadit = new Loader();
addChild(loadit);
var _lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
loadit.load(new URLRequest("scene02.swf"), _lc);
Copy link to clipboard
Copied
thx boss its working great
I have 3 scenes; load scene code is working great
1. How can I unload the scene?
2. Can I unload all scenes or one by one?
can I unload some think like this
Load scene 2 , unload scene 1 and scene 3
Load scene 3, unload other all scene
------------------------------------------------------------------------------
i try this
--------------------------------------------------------------------------------------------------
load2.addEventListener(MouseEvent.MOUSE_DOWN, newvid);
function newvid(event:MouseEvent) {
trace("you clicked me");
var loadit = new Loader();
addChild(loadit);
var _lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
loadit.load(new URLRequest("scene02.swf"), _lc);
loadit.unload();
}
---------------------------------------------------------------------------------------------------------------------
load3.addEventListener(MouseEvent.MOUSE_DOWN, newvid1);
function newvid1(event:MouseEvent) {
trace("you clicked me");
var loadit = new Loader();
addChild(loadit);
var _lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
loadit.load(new URLRequest("scene03.swf"), _lc);
loadit.unload("scene01.swf scene02.swf");
}
Copy link to clipboard
Copied
According to the documentation there is a problem with unload/unloadAndStop below AIR 3.6 on ios:
Amke sure you update accordingly
Copy link to clipboard
Copied
now i try this but still facing the problem
Find more inspiration, events, and resources on the new Adobe Community
Explore Now