How to correctly load an external swf file into iosAir app? I'm getting blank screen.
So this code works flawlesly on Air for Android, it even works fine when I test the movie in Flash, but once I export it, I'm getting a blank screen. I made an swf with a square and withotu any code, and flash still fails to load it. It's weird cause everything works fine when I use the interpreter debugging option, but when I switch to standard debugging the blank screen appears on my ipad. I've read somewhere that it's caused by the way flash saves the link to external files. Thus after the file is compiled Flash fails to find the prefiously added files, which results in a blank screen. There's clearly something wrong with how the process of compiling the application.
Tried this:
var Xpos:Number = 0;
var Ypos:Number = 0;
var loader:Loader = new Loader();
var link:URLRequest = new URLRequest("Untitled-1.swf");
loader.load(link);
addChild(loader);
And this:
var ldr:Loader = new Loader();
ldr.load(new URLRequest("Untitled-1.swf"));
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded, false, 0, true);
function loaded(event:Event):void {
addChild(event.target.content);
But nothing works. I'm still getting a blank screen. Is there any way to add the swf file manually into the descriptor file cause flash most likely messes it up? I don't really want to use through command line.
Read this article, especially the bit about loadercontext and currentdomain:
http://blogs.adobe.com/airodynamics/2012/11/09/packaging-and-loading-multiple-swfs-in-air- apps-on-ios/
Similar Messages
-
FAQ: How do I load an external SWF file into a parent SWF file?
A ton of Flash users visit Adobe’s we site every month wondering about how to load an external SWF file from within another SWF.
Adobe's own TechNote on the subject attempts to answer the basic question, along with some common follow-up questions, including:
How do I load more than one SWF?
How do I load a SWF into a specific location in the display list?
How do I resize the loaded SWF?
How do I set its X and Y location?
Here are some additional resources that elaborate on loading content and on working with the display list:
Sample files for the above TechNote. A set of 3 FLA and 3 corresponding SWF files, including a parent SWF and 2 SWFs that the parent loads.
Help > AS3 Developer’s Guide > Loading an external SWF file
Help > AS3 Developer’s Guide > Loading display content dynamically
Loading multiple external SWFs within a main SWF – CreativeCow.net forums
Video tutorial: ActionScript 101 – Episode 6: Adding named objects to the Stage. By Doug Winnie. An example of how to add the loaded external asset to the Stage and modify its location or other properties.
Video tutorial: Preloading in ActionScript 3.0. By Lee Brimelow. A slightly more complicated example, showing how to make the parent SWF display information about the progress of loading the external SWF.
Tutorial: Loading and unloading SWFs - FlashAndMath.com
This article provides several examples of how to communicate between a parent SWF file and the loaded SWF:
SWF to SWF Communcation via ActionScript 3.0 (by kglad)quote:
Originally posted by:
NedWebs
You now seem to want to get rid of the swf once it has loaded
and played itself thru. To do that you would need to have something
in the swf itself that triggers its removal in its last frame. The
following might work...
MovieClip(this.parent).removeChild(this);
Unfortunately I couldn't get this to work. I placed it on the
last frame of the SWF to be called - is that right?
I am not sure I am doing it correctly... -
How can I load an external SWF into a movie clip that's inside other movie clip?
Hi.
I creating my first flash (actionscript 3.0) website but I'm
stuck with a visual effect I want to create.
I have a window on my website called contentWindow. Every
time you click a button this window is supposed to leave the stage,
load the requested content and return to the stage.
The sliding window is a movie clip with 83 frames, 21 to
enter the stage, 21 to leave the stage again, 20 for nothing (its
just to simulate the loading time) and 21 to return to the stage.
Now my goal is, when the user clicks on a navigation button,
the window exits the stage, loads an external SWF with the content,
and then returns to the stage.
I've the "window" movie clip with an instance name of
"contentWindow". Inside there is another movie clip with an
instance name of "contentLoader". The content that the user
requested should appear inside the "contentLoader".
Now, when the contentWindow leaves the stage, I get this
error message:
quote:
TypeError: Error #1009: Cannot access a property or method of
a null object reference.
at rwd_fla::MainTimeline/trigger()
If I switch
"contentWindow.contentLoader.addChild(navLoader);" for
"contentWindow.addChild(navLoader);" it works fine, but the
external SWF doesn't move with the window.
How can I load an external SWF into a movie clip that's
inside other movie clip?Hi,
Recently, I have been putting together a flash presentation.
And I am just wondering if the following might help you, in your
communication with the said swf file:
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
onComplete);
function onComplete(event:Event):void
event.target.content.thinggy_mc.y -= 100;
Not the best example, but this allows you to target a mc
within an external swf file. I think if you look up this code, you
will have an answer ;)
Kind Regards,
Boxing Boom -
Trouble loading an external swf file implemented with AS3
I am using Adobe Flash CS3
At first, I tried
swf_mc.loadMovie("//swf file
location");
It gave me
quote:
Warning: 1060: Migration issue: The method loadMovie is no
longer supported.
USE: var l = new Loader(); addChild(l); l.load(new
URLRequest("your url"));.
Well, the given code isn't working at all.
But since it is a migration error, I thought maybe I can just
save it into Flash5 format with AS1. Then it worked with most
external swf files. However, the one I am trying to load is a swf
file with AS3, so my older version swf can't load it at all.
Anyone has any ideas about how to load an external AS3 swf
file?AS3 is a completely different beast than AS1 or 2. loadMovie
was removed from the language.
The answer to your question is two fold. First, Adobe was
kind enough to give us the code when it finds a migration issue.
var _ldr:Loader = new Loader();
addChild( _ldr );
_ldr.load( new URLRequest( "your url") );
Handling progress has also changed. I have a ContentLoader
package on my site that you're free to use that should familiarize
you with the new way that things are done in AS3.
http://sd-dezign.com/blog/?page_id=10 -
Can not load an external swf file from my site
Hi ...
I have a fla file which is loading external swf files from my local folders.
I inserted some of the swf files to a web site and tried to load them from the site, not from my local folder...
So it gave me a security error like below:
*** Güvenlik Sanal Alanı İhlali ***security domain-area violation
http://www.celiktek.com.tr/KIRIL.swf' SecurityDomain öğesi -- security domain element, 'file:///C|/Users/Acer/AppData/Local/Temp/Untitled%2D1.swf' uyumsuz bağlamına erişmeye çalıştı - tried to reach this incompatible url
SecurityError: Error #2070: Güvenlik sanal alan ihlali -- security area violation: http://www.celiktek.com.tr/KIRIL.swf arayanı - searcher of this can not reach stage in file:///C|/Users/Acer/AppData/Local/Temp/Untitled%2D1.swf içindeki Stage'e erişemiyor. -
at flash.display::Stage/requireOwnerPermissions()
at flash.display::Stage/get numChildren()
at KIRIL_fla::MainTimeline/frame1()
so in my computer, I can load this swf , but how from a website ?
thnx ...Thnaks ...
I tried to use the securiyt panel that is openede and I added there my site
www.celiktek.com.tr/KIRIL.swf
but I still take the error
*** Güvenlik Sanal Alanı İhlali ***
http://www.celiktek.com.tr/KIRIL.swf' SecurityDomain öğesi, 'file:///C|/Users/Acer/AppData/Local/Temp/Untitled%2D1.swf' uyumsuz bağlamına erişmeye çalıştı
SecurityError: Error #2070: Güvenlik sanal alan ihlali: http://www.celiktek.com.tr/KIRIL.swf arayanı file:///C|/Users/Acer/AppData/Local/Temp/Untitled%2D1.swf içindeki Stage'e erişemiyor.
at flash.display::Stage/requireOwnerPermissions()
at flash.display::Stage/get numChildren()
at KIRIL_fla::MainTimeline/frame1()
from my code
var req:URLRequest=new URLRequest("http://www.celiktek.com.tr/KIRIL.swf");
var lod:Loader=new Loader();
lod.load(req);
addChild(lod);
lod.x=0;
does this code works on your computer ... I know it is a weird question ... you dont have to try ... -
Is it possible to Load External SWF files into Flex Mobile projects?
Hi Guys,
I'm trying to load an external asset in this cse (a SWF file) into my flex project (Apple IOS IPAD), don't get any luck. Can any one suggest a solution ?In Apple's words, "No interpreted code may be downloaded or used in an Application except for code that is interpreted and run by Apple's Documented APIs and built-in interpreter(s)".
Hence external swfs cannot be loaded in iOS. -
I have been trying to load an audible book file into itunes. I did this the last time successfully but this time I get this message either I007 or 1007.Basically I get a asked for the audible pw. I do thid. Then I get itunes not installed correctly I uninstalled and reinstalled ( I did uninstall all the apple files).Now I get the 1007 error code. Anybody?
I downloaded Blue Fire Reader and it requested an adobe id. I clicked on the link that was in the error message stated http//adeactivateadobe.com. Found out that if the date and time on my Ipad is wrong that it won't let me download a book. I was off 5 hours. I reset my clock settings and adobe id let me download a book from the library. I am back to using Overdrive and adobe again on my ipad.
Thank you. -
Load external SWF file into another SWF
Hello all.
I've tried loading a .swf file externally into another .swf file on my local drive, and it works. Now, when I try to Simulate Download, the preloader in the 2nd file doesn't get played and the images in there take a while to get displayed.
I need to load a .swf file from a server into the parent .swf file(I'm working on using a "thin flash file" for added security for the company I work for - blank file which loads the content from another file on their server).
So far, I have:
try
var myLoader:Loader = new Loader();
addChild(myLoader);
var url:URLRequest = new URLRequest("newBook.swf");
myLoader.load(url);
catch (e:Error)
trace("ruhroh");
When I replace the "newBook.swf" with the URL of another .swf, there's just a blank page.
I'm not too sure how to proceed, and I hope you will be able to help me out. I'd greatly appreciate the help.
Many thanks,
-NazgulWhat happens is...when I set the speed to DSL(32.6kbps), the screen is blank and the preloader doesn't show up. It just goes directly to the Main screen. And then, the pages inside don't get loaded properly.
This only happens when I try to Simulate Download.
But that's not really the problem. I need to load a .swf file from a server into another .swf file, and just adding the link to the child .swf isn't working.
Anyway, thanks for your help
-Nazgul -
Loading an External SWF Files not working
Hello,
So I have a project I am working on in which I would like to teach how to cash a scratch off card. I have made the scratch and made it so it will "scratch"
Before: After:
Now I have saved this out and am trying to load this into my "holder" however I am getting an error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at ScratchTicket()
When I use this code:
stop();
import flash.events.MouseEvent;
nextPG_btn.addEventListener(MouseEvent.CLICK, nClick);
lastPG_btn.addEventListener(MouseEvent.CLICK, lClick);
function nClick(event:MouseEvent):void{
nextFrame();
function lClick(event:MouseEvent):void{
gotoAndStop(3);
var mcExt:MovieClip;
var ldr:Loader = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);
ldr.load(new URLRequest("ScratchTicketOnly.swf"));
function swfLoaded(e:Event):void {
mcExt = MovieClip(ldr.contentLoaderInfo.content);
ldr.contentLoaderInfo.removeEventListener(Event.COMPLETE, swfLoaded);
mcExt.x = 50;
mcExt.y = 50;
addChild(mcExt);
What am I doing wrong?
Is it because of my coding in the External SWF?
package {
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.ui.Mouse;
public class ScratchTicket extends MovieClip{
var scratcherIsActive:Boolean= false;
var stuffUnderMask:Sprite = new Sprite();
// init class
public function ScratchTicket():void{
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseIsDown);
stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseIsMoving);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseIsUp);
// make mask
stuffUnderMaskClip.mask = stuffUnderMask;
addChild(stuffUnderMask);
makeCursor();
// helper functions
private function makeCursor():void{
trace("Custom cursor can go here");
// hover effects
private function mouseIsDown(e:MouseEvent):void{
//Mouse.hide();
Mouse.cursor="hand";
scratcherIsActive = true;
private function mouseIsUp(e:MouseEvent):void{
//Mouse.show();
Mouse.cursor="arrow";
scratcherIsActive = false;
private function mouseIsMoving(e:MouseEvent):void{
if(scratcherIsActive){
stuffUnderMask.graphics.beginFill(0x000000);
stuffUnderMask.graphics.drawEllipse(mouseX, mouseY,60, 60);
stuffUnderMask.graphics.endFill();
}// class
}// package
Any help is great!Make sure you check for errors on loading..
import flash.events.IOErrorEvent;
ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, uhOhError);
function uhOhError(e:Event):void
trace(e);
// probably put some visual text field here to display the error
Aside that, on the first block of code mentioned, is that a frame script or running from somewhere in a class? If in a class and it doesn't extend a display object then you can't addChild(mcExt) without erroring. -
How do I load an external swf at a frame after ClickToGoToAndStopAtFrame?
Hi, I'm quite new in working with AS3.
I am designing a site with a menupage with buttons.
Some of these buttons are linked to a frame that contains an external swf, which is a portfolio.
By pressing the buttons 'AQUAREL" and "OLIEVERF" you will go to another frame and the swf-portfolio shows up.
Now the problem is: sometimes it seems to work, sometimes it doesn't.
You can check out yourself at www.erwinvanzijl.nl
Is there a better whay of programming these functions?
Am I doing something wrong or is there a better way to do it?
This is the actionscript that I put on the second frame where the swf is to show up:
stop();
var Xpos_2:Number = 52;
var Ypos_2:Number = 59;
var swf_2:MovieClip;
var loader_2:Loader = new Loader();
var SWF_2:URLRequest = new URLRequest("aquaportfolio.swf");
loader.load(SWF_2);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);
btn_menu.addEventListener(MouseEvent.CLICK, unloadcontent_2);
function unloadcontent_2(event:MouseEvent):void {
removeChild(loader);
gotoAndStop("menu");For the unloading it is a simple matter of...
function unloadcontent_2(event:MouseEvent):void {
loader.unload();
removeChild(loader);
gotoAndStop("menu");
Follow what Dave has to say... he's far more experienced than I. I was too hung up wondering what swf2 was all about to ntoice there were two loaders involved in the code. -
How to load an AS3 swf file into a AS2 swf file?
Hi,
i am trying to display a swf file using AS3 in a flash site which uses AS2. I know that loading the swf file in the normal way, into a dummy movieclip (loadMovie) or into a new level (loadMovieNum), doesn't work. The AS2 based flash site doesn't understand the new file. Is there another way to get around this problem?
Many thanks
92 North Ltd
Leeds website, graphic and web banner design
Phone 0113 815 1158
http://www.92north.comThanks kglad. Will give that a try
92 North Ltd
Leeds website, graphic and web banner design
Phone 0113 815 1158
http://www.92north.com -
Load an external gallery file into a host div via Ajax method?
I was just wondering if anyone has been able to get a spry
gallery to work when placed within an external html file and loaded
into the host div of a page using Ajax method to load. It must work
remotely (on the Internet).
I've tried and mutilated enough sample files, that I'm
continuing my work in Flash and don't have anything un-mutilated to
post at this moment.
If you have, great. Let me know. If you have a link somewhere
it has been done correctly that I can look into and are willing to
post the link, I'd be glad to see it working.
thanx.I am not calling any scripts from an outside server. All of
the external htm files I am pulling are located within the site
root (or in a sub folder of).
What I am trying to do is have two Spry gallery slideshows
(very similar to the demo) coded on separate htm pages that are
brought into divs of the index file (main file).
I have a spry tabbed panels widget. The content for each of
the "TabbedPanelsContent" divs are in external htm files. The
external files that contain basic text, images, and links work
beautifully. The files that have Spry Gallery slideshows in them do
not display properly.
The experimental files I've created are in major disarray
because I've added other issues to test. When I can return to it
and prepare a new troubleshooting file, I will post a link if I
haven't resolved it. -- or the solution if I find it. Mainly I was
wondering if anyone had created something similar so I could
inspect the code to compare.
Thank you for replying Cristian! -
[Q] Loading one external JPG file into different MCs & Downloading
Hi, I was wondering if I set few MCs to load the same
external JPG file, would users need to download thme few times?
Or only need to download once?
I am having trouble loading long 700*8000 jpg files due to
limited pixel size of 2300(?).
I was thking of making them into 2000 * 2000 square pictures
by cutting long picture into short sigments and putting them side
by side.
and using AS to make them appear as single long picture by
using 2 MCs with same image but at different x position of loaded
square Picture.
Anyone have better idea?
I am bit hesitated to make jpg to swf files cuz I have too
many pictures
Plz spare some time for me..
Thank you for your time~!!!!thank you, kglad..
I was thking of making 700 * 8000 image into 2800*2800 image
this square picture works as four (700*2800) images.
So that i can use 2 set of same jpg MC with differnt Masking
to make them
appears as continuously long images
eg. 1st Mc will be showing _x: 0-700
at the bottom of the first MC, 2nd MC will be showing _x:
700-1400
and so on so on..
so..when user is scrolling down..these MCs will makeing
sqaure image
as long portrait image..
I dont beleve myself it is a good solution..
Probably most suitable way would be what you just suggested
me..
Its just that it will be quite a time consuming job to make
jpgs into swfs...
Thank you again for your kindness..:) -
New to Flash and actionscript I have jumped in at the deep
end. I purchased a piece of pre written flash software with
editable XML to display an interactive UK map. This has come
without the Fla source. My problem is when trying to load the swf
into a movie clip on my stage I can not see the map. Something is
there because the cursor changes to a hand shape. I just used the
following line of code:
mc_loader.loadMovie("uk_ir_locator.swf")
where mc_loader is the instance name of an emty movieclip
symbol on my stage.The swf and XML file are both in the same
directory as my file. Can anyone helpAS3 is a completely different beast than AS1 or 2. loadMovie
was removed from the language.
The answer to your question is two fold. First, Adobe was
kind enough to give us the code when it finds a migration issue.
var _ldr:Loader = new Loader();
addChild( _ldr );
_ldr.load( new URLRequest( "your url") );
Handling progress has also changed. I have a ContentLoader
package on my site that you're free to use that should familiarize
you with the new way that things are done in AS3.
http://sd-dezign.com/blog/?page_id=10 -
How to upload and embed Flash SWF file into Google Blogger?
This is my blog URL http://www.aviationandengineering.com
One way is to upload video to blogger. but there is a format problem. I recommend using the H.264 codec with your original file format, and if the file is still too big, switching file formats to .mp4(you can use the SWF video Converter to convert swf to mp4).
The other way is upload to Youtube or another video hosting site, you canembed the video directly into Blogger. There is still a format problem. Youtube can't support SWF video files, so you still need a SWF to Video converter to convert swf to Youtube supported video files and MP4 is the best choice.
Hope this can help you.
Maybe you are looking for
-
Satellite M40-237: How to connect the mobile phone with Bluetooth
I have a new Noki 62333 and I have a Satellite Toshiba M40- 237. I have a big problem with the conection between them. I don t know how to turn on bluetooth on my pc. Can you help me????
-
IPhone 5 Battery is a Bust and the Fixes Won't Help
You can setup your new iPhone 5 as a new phone, and it's not going to solve the problem of battery drain. I tried both ways. First, I restored by 3Gs backup to the new iPhone 5, and then I wiped the new iPhone 5 and set it up as a new phone. There ar
-
Component Palette - Is there a way to..?
The length of the component palette on my JDeveloper 3.1 got reduced for reasons that are not clear to me. I can scroll through the palette to view the components but this is not convenient. When I reinstalled JDeveloper 3.1, the length of the palett
-
Still having difficulty accessing incoming e-mail in iCloud, even after systemsupport says all is normal.
-
Can I read and search a PDF file on my IPAD
Can I read and search a PDF file on my IPAD??