SWF Loader scaling my SWFs
Hello all,
I have a Flex app that loads in a swf using 'SWFLoader' tag.
the SWFloader and the swf being loaded in are the same height and
width (see attached code) Now, the SWF getting loaded in is also
468 X 351 however the designers that made it have crazy amount of
random Movie Clips EVERYWHERE that isn't on the stage. My guess is
that the actual height and width of the SWF is close to 1000 X
1000. When I load this SWF in to my SWFLoader it scales everything
down so all of the MovieClips are inside of this SWFLoader rather
than just the SWF's Stage. Any Suggestions?
"whomba" <[email protected]> wrote in
message
news:glq6j0$b20$[email protected]..
> Hello all,
> I have a Flex app that loads in a swf using 'SWFLoader'
tag. the SWFloader
> and
> the swf being loaded in are the same height and width
(see attached code)
> Now,
> the SWF getting loaded in is also 468 X 351 however the
designers that
> made it
> have crazy amount of random Movie Clips EVERYWHERE that
isn't on the
> stage. My
> guess is that the actual height and width of the SWF is
close to 1000 X
> 1000.
> When I load this SWF in to my SWFLoader it scales
everything down so all
> of the
> MovieClips are inside of this SWFLoader rather than just
the SWF's Stage.
> Any
> Suggestions?
>
> <mx:SWFLoader id="mainMovieSWF" height="351"
width="468"
> source="{mainMovieSrc}" scaleContent="false"/>
Try wrapping it as a component with the Flex component kit.
That way you
get to specify the bounding box.
HTH;
Amy
Similar Messages
-
Hi,
I have a Flex swf loaded into a Flash swf.
I have made the Flex swf transparent, so that the buttons in the Flash swf are visible.
But im unable to interact with the Flash swf buttons.
My Flex swf is working happyily
The Flex swf overlays the Flash swf.
If i change the scrollRect of the Flex swf so the Flex swf is not overlaying the Flash swf i can successfully interact with the Flash swf buttons.
Any ideas?
Regards,
KyleThanks Alex,
I actually found an old post on a forum where you recommended a similar solution (mousesheld.visible = false).
This seems to work although it messes with dragging (my Popups at least).
But i can work with that for now, thanks for your help.
Regards,
Kyle -
SWF loaded into MainNav SWF - Rollovers & Links Don't Work
Hi all,
This is probably a very basic question!
I have a Fla file with Text and Movie clips in it. The Text
is animated when rollover occurs and thumbnail images click and
link to the full size versions.
It works when published (Say "LatestText.SWF").
But when I call it from my Main Nave FLA/SWF, upon loading
the Text.SWF, the rollover anim doesn't happen and the picture
links don't work when clicked.
I have the latest flash player installed and the actual
weblink cursor appears as if the SWF acknowledges everything is
working, but nothing dynamic actually works.
Any Ideas? THANKS ALL! Much appreciated!I'll try to flesh it out, although I don't think there's need
for any code behaviours as they all work fine - until the info.SWF
is loaded into the main.SWF.
So i'll try my best to flesh this out:-
I have a Navigation FLA which publishes to SWF (at the moment
Allow access to Local Files - tried network).
This Nav.FLA is the main bulk of the website, it has all the
links and window panes.
I have a downloaded window pane style component which is an
autoscroller (in case this could be the problem).
I can load my info.SWF's straight into the container, by way
of an Actionscript Anim Frame (1) and when the Nav.SWF is tested or
published, it indeed loads in the smaller info.SWF no problems and
scrolls around beautifully,
The Info.SWF's I'm creating is just basically embedded
dynamic text, with a few movie clips that have Behaviours when
clicked or rolled-over.
These Behaviours do not seem to work when the Nav.SWF's
window pane loads in the Info.SWF - they APPEAR clickable (mouse
pointer changes to hand) but nothing clicks and THEN works. The
rollover animations (actioned via behaviours from LABELS - not
frame numbers) also do not work?
Any ideas from those that know to those that struggle would
be greatly appreciated! It's the first time I've encountered a
problem with my Flash website that I can't seem to find an answer
to in all my tutorials and books!
There's a challenge! -
Tweens don't work in multiple external AS2 SWFs loaded by AS3 SWF
When I try to load a single external AS2 SWF in an AS3 parent
SWF, scripted tweens using the mx.tween class work fine. However,
when I load two or more external AS2 SWFs, the first will work, but
in subsequent SWFs the tweens do not animate. Does anyone have a
solution?
Related post:
http://www.actionscript.org/forums/showthread.php3?t=147637SymTsb,
So what is the code to do that? To delete the TWEEN variable?
easeTime = .5;
var day_handlerX:Tween = new
mx.transitions.Tween(daynightlabel_mc, "_x",
mx.transitions.easing.Regular.easeOut, daynightlabel_mc._x,
(left_point+daynightlabel_mc_leftDifference), easeTime, true);
day_handlerX.onMotionFinished = function() {
trace("day_handlerX="+day_handlerX);
trace("day_handlerX onMotionFinished triggered");
delete day_handlerX;
trace("deleted day_handlerX="+day_handlerX);
does not work. the TWEEN object is still there.
Can ADOBE say something??
AS3 is ... -
My movie swf loaded into another swf
Maybe I'll have better luck posting in this forum
I cant get the movie I have loaded in ( a quiz ) to display
the statistics about how many I have got wrong/right.
is it possible to get it to show the data because it is the
main part of the movie after the user has completed it.
Do I need to put in the Drag and Drop things as well?
Each quiz has one of these. Will the movie find the right
details?
Why should it do this?
I am using load movie actionscript<A
href="
http://uk.geocities.com/[email protected]/indexgame.htm">thi
s page</A>
That URL is fubar. Tried
http://uk.geocities.com/sarah/
http://uk.geocities.com/sarah/indexgame.html
But neither of those work either...
Remove '_spamkiller_' to mail -
How to Load/Unload external SWF
Hey all, I'm in a desperate struggle to meet a deadline for college coursework. I am unable to UNLOAD an external SWF file that I have put inside another SWF file. The problem that is occurring is, although it loads successfully, when I attempt to navigate to another page after viewing the external SWF, I expect it to close as it goes on to another page however, it remains in place. If i then go back on to the page that it is loading from, it will start to keep adding more and more SWF's. The print screens should explain it easier... Below i'll post the code that I'm using currently. The external SWF I am trying to load/unload is an interactive hangman game (whether it being interactive has an effect I do not know), but any and all help with this would be seriously appreciated!
The code currently being used is:
var _swfLoader:Loader;
var _swfContent:MovieClip;
loadSWF("Real Hangman.swf");
function loadSWF(path:String):void {
var _req:URLRequest = new URLRequest();
_req.url = path;
_swfLoader = new Loader();
setupListeners(_swfLoader.contentLoaderInfo);
_swfLoader.load(_req);
function setupListeners(dispatcher:IEventDispatcher):void {
dispatcher.addEventListener(Event.COMPLETE, addSWF);
dispatcher.addEventListener(ProgressEvent.PROGRESS, preloadSWF);
function preloadSWF(event:ProgressEvent):void {
var _perc:int = (event.bytesLoaded / event.bytesTotal) * 100;
// swfPreloader.percentTF.text = _perc + "%";
function addSWF(event:Event):void {
event.target.removeEventListener(Event.COMPLETE, addSWF);
event.target.removeEventListener(ProgressEvent.PROGRESS, preloadSWF);
_swfContent = event.target.content;
_swfContent.addEventListener("close", unloadSWF);
addChild(_swfContent);
function unloadSWF(event:Event):void {
_swfLoader.unloadAndStop();
removeChild(_swfContent);
_swfContent = null;
This printscreen is showing what it looks like in the Flash view (plain background and external SWF loads when this SWF is published)
What it looks like when loaded as published swf
Picture of the external SWF working inside the other SWF
Picture of it not being able to unload when i navigate to another page!
Finally, a picture of it doubling up when i proceed to go on the 'game' page again, it just keeps loading the SWF's rather than unloading them!for example, file1 consits of two buttons, and also considered as main page. As i click on these two buttons , it will lead me go to open the external file2.swf, and file3.swf respectively. (file2.swf and file3.swf could have other navigation buttons, however, i am just simplify here).
the code you provided is working fine. but i want to totally remove/unlink the orginal file (file1.swf) when i click on either buttons which could lead me to other page (file1.swf or file2.swf).
Besides that, in file2.swf and file3.swf could have another "back" button to turn it back to the main page (file1.swf). When the user click on that back button, the file2.swf will unloaded...and file1.swf will be called back again...
can it be done?
so sorry if my poor explanation makes you confuse..
thank you. -
Component Loader resizing external swfs
Hi. Fairly new to Flash. I'm putting together my first full
Flash site. The tutorial I'm following along with for some
assistance is written for Flash8, but I'm using CS3. To try to
minimize differences, I'm doing my files in Actionscript 2.
I've used an instance of the component Loader to load
external swfs (my pages) into the content portion of my main swf.
The problem I've run into is the loaded swfs are showing up at
different sizes. For ease of layout, the document sizes of the
external swfs are exactly the same as the mx.controls.Loader
instance on my main swf. But when they load, one is coming in
slightly larger than the original size, one nearly a quarter of the
size it should be. Everything else works.
In playing around to try to troubleshoot, I made one change
to my home swf (the external that loads immediately with a
Loader.contentPath command. This one had been loading slightly
enlarged), I changed a guide layer so it was a regular layer, no
longer a guide, then it loaded at the right size. When I changed
the layer back to a guide, it loaded somewhat enlarged again. I
tried turning off the guide layer on the other swf that was loading
small, it didn't help. I'm going nuts trying to figure it out.
I thought maybe it might have to do with the fact that some
elements start outside the document frame of the external swfs and
slide in, so I masked all layers to the size of the document. That
didn't help. Is there some scale setting for the Loader component
that I'm not aware of? That would cause the external swf to scale
up or down to fit the size of the Loader instance?
Any help would be appreciated. ThanksThanks. I tried a few more searches in Flash's Help for
Loader scaling and resize and found the scaleContent property, was
just coming back here to say nevermind and saw your response.
Sometimes it takes writing out the problem to spark more
troubleshooting inspiration.
BTW, changing Loader.scaleContent to false did solve my
problem. :) -
Hi, I'm new to the OSMF and have a question about swf scaling. I've done exhaustive searches with every search engine I can think of and haven't found an answer, so I'm posting here in hopes that I can get this resolved quickly. Here's my situation.
I'm using the OSMF to loop through swf, images, and movies. I'm using a serial element and letting it scale contents up to the size of the MediaPlayerSprite. The first time each swf is loaded, it is scaled incorrectly. The 2nd time through, the swf gets scaled correctly.
I'm assuming this is because the scaling is happening before it the metadata for the swf is loaded. I have no guarantees that I can ask that a swf be made in a certain manner, so adjusting the incoming swfs is not an option.
I've tried numerous workarounds with little success. Is there any way to preload the swf so that I have metadata by the time the OSMF needs to play it? Also, any other solutions would be welcome.
Thanks
RobertJared,
(First time poster too!)
I've got the same problem and no amount of anything I've
tried has worked.
However, there is a work around - bit of a pain but it
works...
Publish your fla to Flash Player 6 and then insert you swf
into Captivate 1 (one). Save it then open Captivate 2 (two) and
open the previous saved Cap1 file - accept all the dire warnings
about overwriting etc and it works. Not tried inserting Cap1 files
in the middle of a Cap2 movie yet but I'm sure it can be made to
work.
Adobe - please tell us there's a fix coming out for
this... -
My basic question is: "What are the classes which we should not use for iOS using the packager."
I have been trying for a few days trying to get a simple Flash app to run on the iPad. A very simple app (with sound!) with just 2 classes works fine (Performance is a whole other issue. We will get to that). But if I try anything else, all I get is a white/black screen on the iPad. So it would be really nice to know what classes, functions, etc we CANNOT use for the Packager.
I have fairly simple app (not as simple as 2 classes) which loads some art assets via URLRequest/Loader, puts them on the stage. Fairly common standard practice in AS3.
I've read about not able to load an external file using the Packager. So to fix the situation of loading assets, I have looked into the [embed] tag, which seems to work. I hope the blogger doesn't mind, but this page is an excellent source on what works and doesn't work with the [embed] tag in it's various flavors: http://www.richardleggett.co.uk/blog/index.php/2010/03/08/flash_builder_and_flash_pro_asse t_workflows. For example, AS3 in a swf is stripped out from an external swf using [embed].
The best way to load an external swf file for iOS seems to be using [embed] with "application/octet-stream" and load the swf through ByteArray (Option #4 in the link above). This works great on the PC. HOWEVER, on iPad, it fails. The [embed] tag works on the iPad with the other ways, so my guess is that loadBytes() does not work. Is this true Adobe/Flash guys? Can you confirm this?
My initial question is "why is this not allowed on iOS?". If it is because of the fact that it uses a Loader, can it be changed so it's not using a Loader to construct a MovieClip? I have a ByteArray with the raw swf/MovieClip data. Why can't I construct a MovieClip from it without going through Loader?
This loadBytes() failure seems to be the only thing preventing me from using the normal pipeline of Flash development in loading external assets. If there are other ways people have found, please share!
Now on to performance. Adobe, can you post some examples/samples of code which runs at decent performance? Like a "tech demo" of what is possible using the Packager running on iPad/iPhone. That would be extremely helpful for everyone. I have done a lot of the optimizing suggestions on various sites and pages ( and by Adobe http://www.adobe.com/devnet/flash/articles/optimize_content_ios.html), but I am not seeing the 30 fps performance that is MORE than possible on iPhone/iPad. Displaying and moving around Bitmaps (I don't use any vector graphics) should be blazing fast. Quake runs on iPad without any problems and that code is 10 years old. Moore's law dictates that drawing Bitmaps using CPU should be faster than a 3D engine written 10 years ago... I am trying out the new iOS 4.2 which is supposed to be "significantly" better, but I am still stuck on loadBytes().
So at this point, I am blocked on loadBytes() and my performance for a simple app which draws a few Bitmaps and MovieClips is terrible. I am hopeful some people out there have figured out some solution (there are lots of clever people out there) and I will stumble on to something. But being forced to go native Objective-C seems to be my only option at this point.
In summary, here are the questions I would like to ask the Adobe/Flash group for some more help/information/advise:
- Why is Loader not allowed on iOS? Is it a technical limitation of the hardware/os/Flash? Will it never be supported? What is the future of this class on iOS?
- Why is loadBytes() not allowed on iOS? I have the raw embedded data in memory. I don't need to make a remote call so security should not be an issue. Can I create a MovieClip without using Loader?
- Why is AS3 stripped from the timeline when a Symbol is retrieved using [embed]? Maybe this is the same reason loadBytes() fails, but if I could use [embed] and get a copy of the Symbol, that is what I need. (There are issues with the mx.core.MovieClipLoaderAsset/Asset, but it is better than being blocked by loadBytes())
- What are some apps you guys have written that we can use to compare PC vs iOS? Again, a "tech demo" or sample code of what you as experts in Packager for iOS have done which runs at decent framerate (30+fps) would be of tremendous help. If the Adobe/Flash group hasn't gotten the current Packager for iOS to handle more than 50+ 2D Bitmaps on screen running at 30+fps, that would be good to know. Please let us know what the experts and owners of your software are capable of getting the most throughput using the Packager. I'd hate to sound a bit fed up/angry, but I think you are wasting a lot of people's time and energy with a piece of software that, to me, seems like it was a bit early to release. Flash can do some great things. If it can do it on iOS, even better. But PROVE it to us that it's possible, before having your customers run into barriers imposed on us by trial and error.
Thanks.I have hardly ever seen a post here from someone at Adobe, so you may need to be patient.
Read this article, and get its associated demo files, to see some good performing tech demos:
http://www.adobe.com/devnet/flash/articles/optimize_content_ios.html
Back to your main point, loaders are working, what isn't working for you is accessing of things in the library of a successfully loaded swf, that have been set to Export for ActionScript. That means that the swf you have loaded has an ActionScript Class, to represent the library symbol. iOS Flash apps are native ARM code, and don't include the virtual machines that a browser plugin has, and so it's not able to interpret ActionScript. That may be why it would fail.
Now, I can think of at least a couple of reasons why you might want to have external swfs with elements that you want to reuse in the main swf. One would be if you're intending to make a lot of them, like say if you wanted to have an Asteroids game and the ability to use artwork from a set of different swfs. Another reason might be if you want to skin your interface, by taking specific elements from the loaded swf and using them in the main swf. That way you could have artists preparing those swfs for you, and you just include them in your package, and load the one you want.
There is a way to do either of those things. The second one can be done by having the item as a named symbol on the stage of the loaded swf. With a to-be-loaded swf named "inner.swf", that has a movieclip on its stage named "mc1", this script in the main swf would load that external swf and use its symbol on the main swf's stage, without having to make the inner swf's symbol use ActionScript:
var req:URLRequest = new URLRequest("inner.swf");
var ldr:Loader = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,loaded);
ldr.load(req);
function loaded(e:Event) {
var mc:MovieClip = e.target.content as MovieClip;
var innermc:* = mc.mc1;
innermc.x = 50;
innermc.y = 50;
addChild(innermc);
For the other case, you can take the item off the stage of the loaded swf and draw it into a bitmapdata, and then make as many bitmaps from that as you like. Here's the above example, only it adds the original movieclip to the main swf stage, and also creates a bitmap that looks the same:
var req:URLRequest = new URLRequest("inner.swf");
var ldr:Loader = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,loaded);
ldr.load(req);
function loaded(e:Event) {
var mc:MovieClip = e.target.content as MovieClip;
var innermc:* = mc.mc1;
innermc.x = 50;
innermc.y = 50;
addChild(innermc);
var bmd:BitmapData = new BitmapData(innermc.width,innermc.height);
bmd.draw(innermc);
var bm:Bitmap = new Bitmap(bmd);
bm.x = 150;
bm.y = 150;
addChild(bm);
So, the thing to learn is that a native ARM code application does not have an ActionScript interpreter in it, and if you need to do something that normally requires interpreting ActionScript, find another way to do it. -
Load SWF file in main SWF with parameters
Hello everybody,
I recently got a new flash Application which is a Photo Gallery.
This App is made of multiple folders (source files), a FLA file, a SWF with its javascript SWFObject and an Html page which instantiate this App with some parameters (size, config file path, ...).
It needs an XML file to find all the Photos it displays, to do it I need to configure my application in the HTML Page and give it the "xml_path" :
var so = new SWFObject("index.swf", "gallery", "249", "249", "10", "#111111");
so.addVariable("xml_path","load/config.xml"); // this line is adding the path to the xml file make sure that it's name is xml_path
so.addParam("allowfullscreen","true");
so.write("flashcontent");
By the way, I have a second application, the WebSite, which have to display the Gallery SWF in its "Gallery" page.
Here is how I do it at the moment (in ActionScript3) :
var swfRequest:URLRequest = new URLRequest("C:/......../Galerie/index.swf");
var swfLoader:Loader = new Loader();
//Charge le SWF Galerie dans le SWF Site
swfLoader.load(swfRequest, context);
container1.addChild(swfLoader);
//Positionne le SWF
swfLoader.x=10;
swfLoader.y=120;
It successfully loads the Gallery application but It shows an error telling me it doesn't find the XML configuration file... In the HTML file I simply had to write the "so.addVariable("xml_path","load/config.xml");" to tell where the XML file is...
So, my question is : How can I integrate my SWF application giving it some parameters like above, in Action Script 3?
Thank you ,
PatrickNo, nothing with HTML.
I have 2 SWF applications. One is the Gallery, and the second is my Main Page.
My Main Page must integrate the Gallery module in one of its page.
The problem is when I try to integrate it, I think I must give de future loaded SWF some parameters like this :
(My Main SWF loading in HTML)
var so = new SWFObject("WebSite.swf", "flashcontent", "520", "700", "10", "#111111");
so.addParam("allowfullscreen","true");
so.addParam("allowScriptAccess","always");
so.addParam("menu","false");
so.addParam("wmode","opaque");
so.addParam("bgcolor","#000000");
so.setAttribute("id","flash");
so.write("flashcontent");
It was for the Main App. For my Gallery SWF I had to load it like this (in HTML) :
var so = new SWFObject("Gallerie.swf", "gallery", "249", "249", "10", "#111111");
so.addVariable("xml_path","Galerie/config.xml"); // this line is adding the path to the xml file make sure that it's name is xml_path
so.addParam("allowfullscreen","true");
so.write("flashcontent");
So at the beginning I had 2 different projects with an HTML page for each.
Now I wan't to directly integrate the Gallery SWF into the Main SWF. And as you have seen I must give it some parameters such as the "xml_path" and "allowfullscreen". This must be done in ActionScript 3 and I don't know how...
I think I have to use FlashVars but I don't know how. As I said before, I have tried using the loaderinfo.parameters, but it is in read-only...
Do you have an idea of how I can make it work ? -
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 -
Loading and Unloading of swf files in SWF Loader
Hi all,
I have a doubt reg. SWF Loader.
I have created two mxml files A & B.
A. local.mxml
B. SwfSample.mxml
i have two labels and a button in A file and i have set values to those labels and have a method to handle the click event of the button. In B file i have loaded this A file and accessed the labels and methods using SystemManager Component and changed the values of the A file's label and accessed data from A file to B file.
Here comes the problem,
I have two buttons named LoadAgain and Unload
When i click the Unload button, the SWF Loader unloads its content by the method i handled for the Unload button, after that i have clicked on the LoadAgain button to load the same content of A's mxml to the SWF Loader, it loads succesfully,but i was not able to access its Label or Method from the B mxml. Please help me to solve the issue.
local.mxml
<?xml version="1.0" encoding="utf-8"?><mx:Application
xmlns:mx=http://www.adobe.com/2006/mxml layout="absolute">
<mx:Script>
<![CDATA[
Bindable]
public var varOne:String = "This is a public variable";
public function setVarOne(newText:String):void
varOne = newText;
]]>
</mx:Script>
<mx:Label id="lblOne" text="I am here" x="28" y="88"/>
<mx:Label text="{varOne}" x="166" y="88"/>
<mx:Button label="Nested Button" click="setVarOne('Nested Button Pressed');" x="28" y="114"/>
SwfSample.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx=http://www.adobe.com/2006/mxml layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.managers.SystemManager;
import mx.controls.Label;
Bindable]
public var loadedSM:SystemManager;
private function initNestedAppProps():void
loadedSM = SystemManager(myLoader.content);
public function updateLabel():void
lbl.text = loadedSM.application[
"lblOne"].text;
public function updateNestedLabels():void
loadedSM.application[
"lblOne"].text = "I was just updated" ;
loadedSM.application[
"varOne"] = "I was just updated";
public function updateNestedVarOne():void
local(loadedSM.application).setVarOne(
"Updated varOne");
public function unload():void
myLoader.content.loaderInfo.loader.unload();
public function loadAgain():void
myLoader.load(
"../bin-debug/local.swf");
]]>
</mx:Script>
<mx:Label id="lbl" x="72" y="47"/>
<mx:SWFLoader id="myLoader" width="438" source="../bin-debug/local.swf" creationComplete="initNestedAppProps();" y="73" height="238" x="72" alpha="1.0"/>
<mx:Button label="Update Label Control in Outer Application" click="updateLabel();" x="72" y="319"/>
<mx:Button label="Update Nested Controls" click="updateNestedLabels();" x="72" y="349"/>
<mx:Button label="Update Nested varOne" click="updateNestedVarOne();" x="72" y="379"/>
<mx:Button label="Unload" click="unload();" x="72" y="409"/>
<mx:Button label="Load Again" click="loadAgain();" x="72" y="439"/>
</mx:Application>
Thanks & regards,
Sathish.KcreationComplete only fires once when the SWFLoader is created. Therefore you never reset your variables to point to the new sub-app. On a slow network, creationComplete may fire before the sub-app loads. It is best to use the COMPLETE event.
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui -
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... -
Change the SWF loading text for a single presentation
This question was posted in response to the following article: http://help.adobe.com/en_US/Presenter/7.0/WS8815BC0A-5D22-4f29-87B9-D9047B5B57E4.html
Hi,
I have Adobe Presenter 7.0.5, in which with recently updating to 7.0.7 version.
When I tried the fix of this "Change the SWF loading text for a single presentation" workaround fix, I passed to have the error:ReferenceError: Error #1069: Property ADOBE_PRESENTER not found on Pool_P75.Resource.UIText
But before this error comes, I see that the loading text is changes from the original 2Adobe Presenter" to the one defined by me on the UIText, as the fix said.
And what's happen is that the scrren with the loading text is not being changed by the learning first slide....
Is there any workaround to correct that error?
Many thanks in advance for any feedback from the adobe support team or from any other colleagues that are using Adobe Presenter (;-)). -
How to get the content in embed swf file in Swf Loader on run time
How to get the content in embed swf file in Swf Loader on run time
[Bindable]
[Embed(source="assets/index.swf")]
private var SWFSRC:Class;
<mx:SWFLoader id="_swfloader" source="{SWFSRC}" />Hi Flex harUI,
Throw the error.
Access of undefined property content
Maybe you are looking for
-
Hello! I am trying to print from my iphone 4 to my LEXMARK printer. When trying to select my printer in my phone it comes up and says that there are no printers available... I dont know what to do at this point. Can someone PLEASE HELP??? I also can
-
How to copy sales order item text in to purchase requisition
Hi Experts, We enter text for the sales order items in the sales order item details. we have done settings for the purchase requision to copy text from sales order into purchase requisition and this works for purchase requisitions automatically creat
-
How can I share my music on my Mac to my wife's pc?
I have tins of music in my iTunes library but I really can't figure out so that my wife can play that music on her pc? I am aware of home sharing, I acess all my iTunes on my Mac from my apple tv, iPad and iPhone but how can I set up sharing on the p
-
How can i change which iCloud account my phone is connected to
how can i change which iCloud account my phone is connected to
-
Reading project... stops at 28%
Just installed Leopard to a new volume, and hat all Application files transferred to it during the install. Final Cut Pro works with the exception of one (the most important one!) project. When trying to open it, it stalls at 'Reading project... 28%'