Loading External SWF that loads XML
Hey all I have a swf that loads an swf file into that loads pictures from an XML file thanks to Ned Murphy. I have a new problems with it. It works everywhere I try it except on the webserver. When I try it I get nothing. It doesnt seem to load the external SWf file or it may not be loading the XML file. I am not sure why. Has anyone ran into this before ? thanks.
EDIT
It works if I try the SWF from the webserver but when I embed it in an HTML file and run it through a broweser I get nothing.
If the swf is is another folder from the html page that embeds it, you probably need to adjust how you target the files that the swf's load.
When you embed an swf file into a web page, anything the swf loads has to be targeted as if that swf is in the same folder as the html page that holds it. So if the html page uses something like "flash/main.swf" to embed the top level swf, then if the top level file loads another swf from that same flash folder it needs to also use the "flash/other.swf" regardless that it is in the same folder on the server. When it's embedded in the page, it's as good as being wherever that page lives.
Similar Messages
-
Loading an external swf that loads an object from url
i am trying to load an external swf that in turn automatically loads an object. i want the external swf to only be loaded once the object is loaded in it. right now it loads the external swf first and then the external swf loads the object specified at a url...
thanks kglad. i think i need to try and load the external swf, wait for it to load its object, and then display it... will look into it and get back...
-
Load external swf thats AS3 in a AS2 swf
i have a website made in actionscript 2, and now i need some
functions from actionscript3 that actionscript 2 doesnt have, so im
trying to load a external actionscript 3 swf in to a actionscript 2
swf, is this possible?
im using _root.mc.loadMovie("ms.swf");
cuz it doesnt seem to workah ok thanks
have any idea how to load text into swf in AS2.0 without
having a tag like text= ... because as far as i know only AS3's
URLLoader can do it. -
Loading an external SWF from an external SWF
Hello,
I'm somewhat caught between a rock and a hard spot on a flash
site project. Here is the situation:
I have created a parent movie (which loads all external SWFs
inside of it) that has the menu navigation built into it. However,
my client wants me to place some more links inside of the external
SWFs that lead to other pages (external SWFs) of the site. Is this
at all possible? I was hoping there is a way to tell a button in an
external SWF to make the parent movie switch between external SWFs.
Any and ALL help is very much appreciated. Thank you.
Another question: does this involve using the _parent script?
ElijahHello,
Thank you for replying. Here is exactly what I'm needing to
do:
We will call the parent file "index.swf". Inside "index.swf"
I have a "holder" for external swf files to load into when I call
on them from the main menu buttons on "index.swf". When a customer
comes to the site, the "index.swf" file initially loads
"welcome.swf". Inside of "welcome.swf", I have some images that I
want to make into links to other external swf files.
My problem is when someone clicks on one of those pictures I
want the "index.swf" file to open up the corresponding external swf
file in its "holder", where "welcome.swf" currently resides. Also,
all of these swf files ("index.swf" included) have stand-alone FLA
files, none are attached to one another. I have never worked with
"levels" before, would that be necessary in this case? I have
attached the code for the external swf loader.
I hope that gives you a better idea of what I'm trying to
accomplish.
Thanks again.
Elijah
CODE: -
How to load and unload Multiple External SWF
hello there,
i need help to figuring out how to load and also unload(removing) multiple external SWF.
so here is what i;m trying to do,
i want to load multiple external SWF and play it on my main SWF now i hove no problem with just loading multiple SWF and placing it in the display list .The problem came up when i tried removing those loaded SWF from the display list ,The problem exist because i have no way to refer to what i have loaded and placed on the display list,
i used a single loader instance to load all that external swf,
i do know that we have to remove all the event listener related to the external SWF that we want to remove and for this purpose i have crated a function called destroy which the main objective for this function is to remove all event listener inside the swf and also isolating all variable so it would be eligible for garbage collecting, here is what the code look like:
// Create this in every object you use
public function destroy():void
// Remove event listeners
// Remove anything in the display list
// Clear the references to other objects, so it gets totally isolated
sorry it just a kind of pseudocode cause this function will customize with it's own property i did this just for the purpose of simplicity and easy understanding..,
so now back to main problem how should i solve this problem??
i tried used an arraf to save all the loaded swf
the array is just used to save the what the loader is loading but the adding to display method is using
movieClipActAsContainer.addChild(e.target.content); //the event is from the Event.COMPLETE
but i have a hard time using that arrya back and matching it to the one i got from the display list.
please do help me,
any suggestion would be greatly appreciated,
and if can pleas show me a source code or pseudocode of what you're suggesting to me cause my english is not so fluent yet,
thanks before.Hey EI,
I had done this kind of project recently and for loading and unloading different swfs. I had used loaders specific to that filename and for removing I had used a single movieclip instance name and on clicking that specific loader request name that needs to be removed will be requested from the specific function. As mentioned below
Loading SWF:
===============================
swfLoaderIndia.load(swfRequestIndia);//This will load the request
If you are inside a movieclip while requesting use below code
MovieClip(this.root).addChild(swfLoaderIndia);//This will load swf on stage
or else
Stage.addChild(swfLoaderIndia);
Unloading SWF
=====================================
If you are inside a movieclip while requesting use below code
MovieClip(this.root).removeChild(swfLoaderIndia);//This will unload swf on stage
or else
Stage.removeChild(swfLoaderIndia);
Above code will be in specific function which will be requested when the loading and unloading is required.
I hope this helps you in your project.
With Regards,
Sagar S. Ranpise -
Some of my external swf flies will not load
I am using CS6 on windows 7, 64 bit
I work totally in code with a main class calling in library items and objects.
I am loading an external swf, then when a button is clicked the swf is unloaded and another one is loaded in.
Most of the swfs were produced in CS5 but I have republished them all in CS6 with the same settings as the parent swf. ( I know this can be a problem if the versions are different)
2 of the swfs load fine and the others give the following error message
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Main()
when it tries to implement:
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,imageLoaded);
Which seems to say it can't find the file. ( If I name one of the working files to be the same name as one of the failing files it works fine!)
It doesn't matter what order the swfs are loaded in the same ones load and the same ones fail!
By a process of elimination I think there must be something different about the swfs that don't work. As Ihave published them all using CS6 with the same settings at the parent swf I have no idea what the problem is.
Is there anything that may cause problems and stop a swf being loaded?
thanksHi Ned,
Thanks for the debugging tip. That has helped me move slightly further forward.
I now have bare code that just loads in an external swf so I could test a few different ones.
I work with graphic designers who work on the timeline and often import/copy and paste from illustrator/inDesign.
Having tested a few different external swfs made by differnt people I have found slighly different results.
Some load fine - hooray!
others produce this error and get stuck in loop but something does eventually show:
ReferenceError: Error #1056: Cannot create property __rslLoaders on Main.
at fl.rsl::RSLPreloader/contentComplete()
and others produce this error after seeming to be in a loop and nothing shows, then when I close the flash player I get
Error #2044: Unhandled ioError:. text=Error #2036: Load Never Completed.
So I get the feeling it must be something in the external swfs that the parent swf doesn't like. -
Why can't I load external .swf CheckBoxes?
Hello, world...
I'm trying to load an external .swf that contains some checkboxes. The extenal .swf has a server-side script in applications folder on FMS3.
When I load the external .swf in local, it works fine.
If I load the external .swf in remote using an Apache Web Server, the external .swf is loaded but the checkboxes don't appear...
Why?
Please, help me...
Emiliano.Hi, JayCharles...
My main .swf is located in:
\\MYSERVER\Apache2.2\htdocs\fms3\Logopedia\Lato Dottore\VideoComm.swf
instead, the external .swf is located in:
\\MYSERVER\Apache2.2\htdocs\fms3\Logopedia\AnalisiVisiva.swf
From server-side script I pass this URL:
var mySWF_URL3 = "http://192.168.1.67/fms3/Logopedia/AnalisiVisiva.swf";
I have another external .swf that contains TextInputs instead of CheckBoxes and it works fine...
Why does TextInput work and doesn't CheckBox work?
Perhaps the CheckBoxes do not be loaded?
Please, help me...
Emiliano -
Loading library assets from external .swf
Ok, so here's what I want to do. I'm creating an application
that has optional classes that it can instantiate based on what the
needs are. These classes operate things like Session Logging
utilities, etc. These items obviously have assets that they need
available such as movieclips and buttons. For example, the Session
Logger has a sessionLog_mc clip that has a log window with buttons
and the log display. I want to be able to have my class load the
external .swf that contains the assets for the Session Logger and
then use attachMovie(), once the .swf is loaded, to attach the
sessionLog_mc from the library of the loaded external .swf file.
This does NOT seem to work at all. This seems like it has to be
possible. I don't want to be forced to put all my code into
external .swf's too. I just want some external asset .swf's (or
maybe just one large one) that I can load. Is this possible? I am
wanting to have the ability to show the progress of loading each of
these components while the application is starting up and loading
the asset files. Thanks so much!
Here is an example of what I'm trying: (the attachMovie does
NOT work at all)I see now how to import and display a library class object
using:
var MovieClipClass:Class =
Class(loader.contentLoaderInfo.applicationDomain.getDefinition("myLibraryAsset"))
var movieClip:Sprite = new MovieClipClass();
addChild(movieClip)
But this seems to only work for SWF's published for AS3 Flash
Player 9.
I need to do the same for SWF's published with AS2 Flash
Player 7.
Any ideas? -
External .swf runtime linkage .pngs AS3
Flash can compress .png files like Photoshop can compress
.jpg files better than any other tool hands down.
I have 77 .png files that are 1.8 .megs on my c: drive after
I imported them and setting the file compression under the "File
> Publish Settings" to 75% for jpg and published the .swf with
all the .png on the stage the file size is 350K that's about 20% of
the original file size of the .pngs downloaded file by file with 77
separate request.
I can create linkage in the shared .swf and test the movie
with code in the shared .swf to add the movieclip holders for each
.png to the stage but when I load the shared .swf into the main
.swf Flash acts like it can't create the classes based on the
linkage I setup or that the MovieClip linkage doesn't exist.
I tried a test to have the shared .swf with all the .pngs and
linked movieclips to add the assets to it's own stage and it works
fine but that means a lot of my code and logic is included in the
shared .swf that the designers need to add .pngs to. It's
unfortunate AS3 sucks but I'm just about done with the project if I
knew what a battle AS3 was going to be I would have stayed with AS2
my next projet will be AS2 no question non at all. Anyway I setup
"class" linkage identifier for each .png with a movieclip holder
for each image. The 20% of the size for the pngs and one request
vs. 77 separate request makes it worth the extra effort of
importing the images, creating a holder movieclip with linkage but
the main .swf that loads the shared .swf with all the assets and
linkage can't see or create the assets like the shared .swf can
when I test it.
We need to have the main .swf get a handle of the linked .png
assets and place them in the main .swf to load the assets to
different parts of the main .swf. It's cute that the shared .swf
can add the linked assets to it's own stage but not too useful.
Also the way we deploy we cannot roll out a new release/build to
update the .pngs but we can upload a new .swf to the asset server
so the .pngs need to be in a separate .swf. I can get the shared
MovieClip to add the linked assets to it's own stage when testing
and when loading my problem is the main .swf that loads the shared
.swf cannot create instances of the classes that are exported for
runtime sharing using linkage.
If it is possible I would like to know how the heck you get a
handle on a linked asset in an externally loaded .swf. Preferably
without creating my own prototyped insane class consisting of mega
libraries of external .as files. Just a way to reference MovieClips
holding pngs that have linkage and are setup for runtime sharing.
It really shouldn't be this hard it's a simple task in AS2. I'm not
looking for a coding competition or some wild class to do the job I
want a few lines of code to create an instance of a class then
reference to the linkage/MovieClip holding the .png to addChild it
into a target movieclip.I solved it I'm loading 77 embedded assets in an external
.swf that compresses 77 .png images without loosing quality it
works great. -
Importing fl.controls causes external .swfs to crash
Hello,
I've discovered that if I use fl.controls.* classes in my AS3
code, and then load an external .SWF that uses something like
fl.controls.combobox, I will get a crash when clicking on the
combobox.
The crash is as follows:
TypeError: Error #1009: Cannot access a property or method of
a null object reference.
at fl.containers::BaseScrollPane/drawBackground()
at fl.controls::List/draw()
at
fl.core::UIComponent/drawNow()[fl\core\UIComponent.as:1198]
at fl.controls::List/scrollToIndex()
at fl.controls::SelectableList/scrollToSelected()
at fl.controls::ComboBox/open()
at fl.controls::ComboBox/onToggleListVisibility()
I am not creating new fl.controls.* objects in my AS3 code, I
am merely trying to type them correctly so I can reference them in
code. For example, with the following code, the app crashes:
public function getButton(buttonNum:int):Button
return mDialog["button" + buttonNum];
If I change that code to return Object instead of Button, the
code works fine.
Any thoughts???thanks….maybe it isn't a actual kernel panic….I was not sure what to call it….the old kernel panic were in UNIX code…this is a SYSTEM NEEDS TO BE REBOOTED
and it is only with LIGHTROOM
no other app causes this.
I can't find the copy paste of the actual SYSTEM REPORT
I will try to repeat it…..and copy it for everyone to see today….
thanks
I greatly appreciate your help
jsm -
Play - Pause button for external .swf?
I'm trying to create buttons so a viewer can pause and then play an externally loaded swf. My project can be accessed at the linke below. This is how I want the project to function
-Click a room on the building (choose Accounting for this discussion)
-Click one of the demo options (choose Ending a Period for this discussion)
- Now that the demo plays, I want the user to be able to play and pause the demo swf.
The demo .swfs were created in Captivate so I don't have access to their timeline. They are loaded into an empty Loader component using the MovieClipLoader Class. Can anyone post some possible solutions to this problem? Thanks!
http://distribution.activant.com/demos/prophet21-on-demand/What would that look like? Right now they're loading using the following code:
btnCashCollect_btn.onRelease = function () {
mcLoader.loadClip("CashCollections.swf",myLoader);
btnEndPeriod_btn.enabled = false;
btnCashCollect_btn.enabled = false;
btnFinancialMGMT_btn.enabled = false;
_root.btnHome_mc._visible = false;
So would I use something like:
btnPause.onRelease = function() {
myLoader.content.pause();
Actually I just tried that and it didn't work...I need the buttons to work for multiple external swfs that will be loaded into myLoader -
Getting external swf to stay visible?
Hi
I have an external swf that contains a button that controls my main swf's timeline.
I can get it to navigate fine, but as soon as it navigates, my external swf disappears, because my main swf is no longer on the frame my external swf was imported on.
How do I get the external swf to stay visible along all the frames of my main swf's timeline?
Here's the code I use to import the external swf:
var external_swf:MovieClip;
var loader:Loader = new Loader();
var import_me_SWF:URLRequest = new URLRequest("external_mc.swf");
loader.load(import_me_SWF);
loader.x = 0;
loader.y = 0;
addChild(loader);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, dataOnLoad);
function dataOnLoad(evt:Event): void {
external_swf = MovieClip(evt.target.content);
Thanks guys.
ShaunSOLUTION:
Ok - here's a solution I experimented with for anyone that needs a similar fix:
1. Create a new layer where you would like the external swf to go (in my case, the layer is on the top).
2. Draw a rectangle (doesn't matter what it is really), convert it to a movieclip symbol, and give it a color effect APLHA of 0 so it's invisible. Give it an instance name - I named mine 'external_swf_holder'
3. Adapt the external loader code like this...add 'external_swf_holder' to the beginning of the external clip name, with a dot in between:
var external_swf:MovieClip;
var loader:Loader = new Loader();
var import_me_SWF:URLRequest = new URLRequest("external_mc.swf");
loader.load(import_me_SWF);
loader.x = 0;
loader.y = 0;
addChild(loader);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, dataOnLoad);
function dataOnLoad(evt:Event): void {
external_swf_holder.external_swf = MovieClip(evt.target.content);
4. That's it. Now Flash should always keep your swf on the layer that 'external_swf_holder' is on.
Cheers
Shaun -
Preloader in external swf not working
I have several external SWFs that are loaded into my site and
each one has a preloader. When I run them by themselves the
preloader works fine, but when it is embeded into the main SWF the
preloaders do not work. Any ideas?
here is my actionscript -
lBytes = _root.getBytesLoaded();
tBytes = _root.getBytesTotal();
percentLoaded = Math.floor((lBytes/tBytes)*100);
loader.bar._xscale = percentLoaded;
loader.percent.text = percentLoaded + "% of " +
Math.floor(tBytes/1024) + "K loaded.";
if (lBytes>=tBytes && tBytes>0) {
if (count>=12) {
gotoAndPlay("enter");
} else {
count++;
gotoAndPlay("preload");
} else {
gotoAndPlay("preload");
}I am experiencing the exact same problem on my site -
www.expansiondesign.com
It works in flash player but not when live (tested safari and
firefox)
I don't know if you are using the same script as I am paul.
I execute the following when each image button is pressed:
button1.onRelease = function () {
startLoading("image1.jpg");
which runs this:
function startLoading(whichImage) {
loadMovie(whichImage, "_root.image_holder");
_root.onEnterFrame = function() {
infoLoaded = _root.image_holder.getBytesLoaded();
infoTotal = _root.image_holder.getBytesTotal();
percentage = (infoLoaded/infoTotal*100);
_root.loader._yscale = percentage;
_root.loader._visible = true;
if (percentage>=100) {
delete this.onEnterFrame;
_root.loader._visible = false;
Thanks,
Barton -
External swf question...
Hey all
I found this code for loading external swfs and playing them in succession.
It works when I use the external swfs that come with the code, but not when I try to use any other external swfs.
I can't figure out why - does anything seem obvious (the clip swfs are here http://www.flashandmath.com/intermediate/externalclips/clip0.swf http://www.flashandmath.com/intermediate/externalclips/clip1.swf http://www.flashandmath.com/intermediate/externalclips/clip2.swf ):
// Array of external clips to use. Variable index refers to next clip to be displayed.
var clips:Array = ["clip0.swf", "clip1.swf", "clip2.swf"];
var index:int = 0;
// Stuff to load swf files
var thisLoader:Loader = new Loader();
thisLoader.contentLoaderInfo.addEventListener(Event.INIT, doneLoading);
//loader.contentLoaderInfo.addEventListener(Event.COMPLETE, dataOnLoad);
var thisMC:MovieClip = new MovieClip();
stage.addChild(thisMC); // Add empty MC initially so the nextClip function can be generic
// Removes old MC and gets the next one, waiting until when it has initialized beore adding it to the stage
function nextClip():void {
thisLoader.load(new URLRequest(clips[index]));
// Tell AS that the loaded file is a movie clip and add it to the stage.
function doneLoading(e:Event):void {
stage.removeChild(thisMC);
thisMC = MovieClip(thisLoader.content);
thisLoader.unload();
thisMC.addEventListener(Event.ENTER_FRAME, runOnce);
stage.addChild(thisMC);
thisMC.gotoAndPlay(1);
// When thisMC has finished, play the next clip.
function runOnce(e:Event):void {
if (thisMC.currentFrame == thisMC.totalFrames) {
thisMC.removeEventListener(Event.ENTER_FRAME, runOnce);
index = (index + 1)%(clips.length);
nextClip();
// Call the nextClip function initially to get the ball rolling
nextClip();
Thanks for taking a look guys.
ShaunOne of the swfs returns:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::AVM1Movie@26f9b3a1 to flash.display.MovieClip.
at alt2_fla::MainTimeline/doneLoading()
(I'm pretty sure it's an AS3 swf)
The other, which I had just built using AS3, returns:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at fl.rsl::RSLPreloader/loadContent()
at _001_fla::MainTimeline__Preloader__/frame2()
Error: Error #2099: The loading object is not sufficiently loaded to provide this information.
at flash.display::LoaderInfo/get width()
at loader_animation_fla::MainTimeline/frame1()
Error: Error #2099: The loading object is not sufficiently loaded to provide this information.
at flash.display::LoaderInfo/get width()
at loader_animation_fla::MainTimeline/frame1()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at fl.rsl::RSLPreloader/loadContent()
at _001_fla::MainTimeline__Preloader__/frame2() -
External swf unload & stop not working
I am trying to load & unload external swf that contain audio & video. Problem is that when I unload the swf's, the sound continues and I get overlapping sound. This is the code I am using:
var swf_loader:Loader = new Loader();
///unload previous swf
swf_loader.unloadAndStop();
removeChild(swf_loader);
////load new swf
swf_loader.load(new URLRequest("welcome.swf"));
swf_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, finishLoading);
function finishLoading(e:Event):void{
if(swf_loader.content){
addChildAt(swf_loader, 0);
swf_loader.y = 75;
swf_loader.x = 0;(welcome to the stupid-error club. you're in good company.)
and, you're welcome.
Maybe you are looking for
-
How can I change my Apple ID that is set up with an old email that does not exist anymore
I set up an Apple ID years ago with a hotmail email account. I also deleted that hotmail email account years ago. I now have a gmail email. I cannot back up anything to icloud because of my apple id that is connected to the hotmail email account that
-
RFC - XI - JDBC - cannot insert in Table !
Hi Experts... I have a scene RFC - XI - JDBC ! When executing the application in the SXMB_MONI my status is processed successfully! But cannot insert the data in SQLServer Tables ! Im Message Monitoring i have the erros: Error No "action" attribute f
-
Sun AppServer 9.0 Update 1 on Solaris not supporting form-based auth
Ok, I installed Appserver 9 on a Solaris box and then started up the default domain1. When I point the browser to http://localhost:4848 I am not pointed to the login page for the admingui, it just bypasses the authentication and I am allowed to perfo
-
Exporting and retaining quality
Hi there. I'm having some issues exporting from Premiere Pro CS5 and retaining image quality. Rather than retype the problem could I ask you to have a look at the following blog post where I break down the problems I'm having and give some examples.
-
Is anyone else having problems with Font Book?
Recently tried to add some Hallowe'en fonts. Font Book seems to start, i.e., the first page opens, but it refuses to add the font, and sits there spinning the beachball. I have to force quit, get a demand to report to Apple - which I have now done 3-