• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

384

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

Community Expert , 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;

Votes

Translate

Translate
Community Expert ,
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".

Votes

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()

Votes

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 Expert ,
Oct 10, 2020 Oct 10, 2020

Copy link to clipboard

Copied

ios app?

Votes

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!

Votes

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 Expert ,
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);

Votes

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);

 

Votes

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));

 

 

Votes

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 Expert ,
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;

Votes

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));

 

Votes

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

Votes

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 Expert ,
Oct 13, 2020 Oct 13, 2020

Copy link to clipboard

Copied

what's decodedObj.arquivo?

Votes

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 Expert ,
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.

Votes

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! 

Votes

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 Expert ,
Oct 13, 2020 Oct 13, 2020

Copy link to clipboard

Copied

LATEST

you're welcome.

Votes

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