Hi good morning! How do I fix this error I have no idea / adobeAir SecurityError: Error #3226: Canno

Community Beginner ,
Oct 10, 2020 Oct 10, 2020

Copy link to clipboard

Copied

import flash.utils.ByteArray;
import com.adobe.serialization.*;
import com.adobe.serialization.json.JSON;
import br.com.MundoSabido.Base64;

////////////////////////////////////////////////////////////
teste.addEventListener("click", btnClick);

var request = new URLRequest("http://192.168.0.105:3000/imagens/1");
var reqSwf: URLLoader = new URLLoader();

function btnClick(event: MouseEvent): void {
request.method = URLRequestMethod.GET;
trace("antes");
try {

reqSwf.load(request);
} catch (error: Error) {
trace(error.message);
}
trace("OI")
}
////////////////////////////////////////////////////////////

var Xpos: Number = 0;
var Ypos: Number = 0;
var swf: MovieClip;
var loader: Loader = new Loader();

 

reqSwf.addEventListener(Event.COMPLETE, function (e: Event): void {
var decodedObj: Object = com.adobe.serialization.json.JSON.decode(e.target.data);
//trace(decodedObj.arquivo);

/* trace(decodedObj.firstName);
for(var key:String in decodedObj) {
trace("Name: " + key + " - Value: " + decodedObj[key]);
}
*/
//trace(decodedObj.arquivo);

trace("arquivo "+decodedObj.arquivo);
loader.loadBytes(Base64.decode(decodedObj.conteudo));
trace("deu certo ")
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);

});


reqSwf.addEventListener(IOErrorEvent.IO_ERROR, function (e: IOErrorEvent): void {
trace("deu errado ")
trace(e.target.data);
});

/*reqSwf.load(request);*/

return

Views

158

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Oct 13, 2020 Oct 13, 2020
you have to use URLRequest(yourswf);   loader.load(new URLRequest("whatever.swf",lc));   and you have to enable the allowCodeImport property of your loadercontext if there's code in the loaded swf   lc.allowCodeImport=true;

Likes

translate

Translate

Translate
Adobe Community Professional ,
Oct 10, 2020 Oct 10, 2020

Copy link to clipboard

Copied

upload to a server and test or check your publish settings to see if you can disable "access local files only".

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 10, 2020 Oct 10, 2020

Copy link to clipboard

Copied

keeps giving this error what else can i do?

 

 

SecurityError: Error #3226: Cannot import a SWF file when LoaderContext.allowCodeImport is false.
at flash.display::Loader/_loadBytes()
at flash.display::Loader/loadBytes()
at Function/<anonymous>()[ANDROIDCARREGARSWFDIMANICO_SWF__fla.MainTimeline::frame1:48]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 10, 2020 Oct 10, 2020

Copy link to clipboard

Copied

ios app?

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 10, 2020 Oct 10, 2020

Copy link to clipboard

Copied

ios and apk both give the same error!

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 10, 2020 Oct 10, 2020

Copy link to clipboard

Copied

your loader must provide a loadercontext object that uses the current applicationdomain:

 

var lc:LoaderContext=new LoaderContext(false,ApplicationDomain.currentDomain,null);

yourloader.load(yourexternalswf.swf,lc);

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 13, 2020 Oct 13, 2020

Copy link to clipboard

Copied

var decodedObj: Object = com.adobe.serialization.json.JSON.decode(e.target.data);
var lc: LoaderContext = new LoaderContext (false, ApplicationDomain.currentDomain, null);
yourloader.load (yourexternalswf.swf, lc);

loader.loadBytes(Base64.decode(decodedObj.conteudo));
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);

 

how it would look in context using this cod????

 

var lc: LoaderContext = new LoaderContext (false, ApplicationDomain.currentDomain, null);

yourloader.load (yourexternalswf.swf, lc);

 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 13, 2020 Oct 13, 2020

Copy link to clipboard

Copied

Hi is new error! Look ->

 

TypeError: Error #1034: Type Coercion failed: cannot convert "sistematização_de_tabuada_3_ANO_8.swf" to flash.net.URLRequest.
at Function/<anonymous>()[ANDROIDCARREGARSWFDIMANICO_SWF__2__fla.MainTimeline::frame1:37]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()

 

//////////////////////////////////////////////

var decodedObj: Object = com.adobe.serialization.json.JSON.decode(e.target.data);

var lc:LoaderContext=new LoaderContext(false,ApplicationDomain.currentDomain,null);
loader.load(decodedObj.arquivo,lc);
loader.loadBytes(Base64.decode(decodedObj.conteudo));

 

 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 13, 2020 Oct 13, 2020

Copy link to clipboard

Copied

you have to use URLRequest(yourswf);

 

loader.load(new URLRequest("whatever.swf",lc));

 

and you have to enable the allowCodeImport property of your loadercontext if there's code in the loaded swf

 

lc.allowCodeImport=true;

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 13, 2020 Oct 13, 2020

Copy link to clipboard

Copied

Is new error 1!

 

Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

/////////////////////////////////////////////Cod

var lc:LoaderContext=new LoaderContext(false,ApplicationDomain.currentDomain,null);
loader.load(new URLRequest(decodedObj.arquivo),lc);
lc.allowCodeImport=true;
////////////////////////////////////////////////
//loader.loadBytes(Base64.decode(decodedObj.conteudo));
//loader.loadBytes(Base64.decode(loader.conteudo));

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

Is new error 2!

 

SecurityError: Error #3226: Cannot import a SWF file when LoaderContext.allowCodeImport is false.

/////////////////////////////////////////////Cod

var lc:LoaderContext=new LoaderContext(false,ApplicationDomain.currentDomain,null);
loader.load(new URLRequest(decodedObj.arquivo),lc);
lc.allowCodeImport=true;
////////////////////////////////////////////////
loader.loadBytes(Base64.decode(decodedObj.conteudo));
//loader.loadBytes(Base64.decode(loader.conteudo));

 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 13, 2020 Oct 13, 2020

Copy link to clipboard

Copied

follow the link if you want to see the .fla file and help me!

 

https://mega.nz/file/r35jzCCJ#buh0wQgjPiAkQd0fuES8GC_2Y3-g8eyh7HL_UkCTEfA

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 13, 2020 Oct 13, 2020

Copy link to clipboard

Copied

what's decodedObj.arquivo?

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 13, 2020 Oct 13, 2020

Copy link to clipboard

Copied

i don't download and fix fla files unless i'm hired.  if you want to hire me to solve this for you, let me know.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 13, 2020 Oct 13, 2020

Copy link to clipboard

Copied

Thank you it worked! 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 13, 2020 Oct 13, 2020

Copy link to clipboard

Copied

you're welcome.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines