Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
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

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

669
Translate
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;

Translate
Community Expert ,
Oct 10, 2020 Oct 10, 2020

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

Translate
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

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

Translate
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

ios app?

Translate
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

ios and apk both give the same error!

Translate
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

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

Translate
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

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

 

Translate
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

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

 

 

Translate
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

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;

Translate
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

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

 

Translate
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

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

 

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

Translate
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

what's decodedObj.arquivo?

Translate
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

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.

Translate
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

Thank you it worked! 

Translate
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
LATEST

you're welcome.

Translate
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