Call external swf from an swf in Flex - actionscript-3

I am new in Flex and I face some difficulties..
I have a swf gallery that load external swf files when you click differnet button..
I have load this swf inside Flex but when I click the buttons it doesn't load the external files..
I use this
<mx:SWFLoader source="#Embed(source='test2.swf')"
I assume that maybe there are some security issues in flex where you can't loda external swf??

You are mixing dynamic swf loading with embedding assets.
The syntax #Embed is used for embedded assets that are included in the application binary, during compilation.
You should write:
<mx:SWFLoader source="test2.swf"
to dynamically load a swf file from the same web server than your app.

Related

Does preloading an external SWF also preload external MP3s?

I have an .swf file which loads several external MP3s, I want to make a preloader with an animated progress bar to ensure all of the Mp3s are loaded before the user can interact with the timeline. I have seen some people embed the MP3s in the flash file and then preload that .swf into another loader .swf.
I dont want to embed the MP3s, but would consider using a lader movie to load the main movie, will this method still work with external mp3s?
I have used AS3
A loaded SWF will maintain it's AS3 code no matter if it's from the document class, on timeline or both.
If you have a Main SWF that loads an External SWF and External SWF is loading an MP3 file there is no problem with it what so ever.
Be careful with the loading security standards and the External SWFs loading sequence. Since it's a loaded SWF it will not have access to stage instantly (even in document class), in stead it will get it after it is added to stage (use ADDED_TO_STAGE event listener). It shouldn't be a problem if you're frame-scripting.
You might want to make a method in the External SWF that starts loading the MP3.

Embed Adobe AIR application in html with swfobject

I've a .fla program that decompresses ZIP files using BiteArray.
In order to use this BiteArray I change the publish settings of the document in Adobe AIR.
I tried to embed this app in an HTML page as you would for a swf file, so with SWFObject, but nothing is shown, even if I run the swf locally.
There is a particular way to manage an swf in Adobe AIR?
There is no way you can embed an AIR app in a html. AIR is for desktop applications (or mobile).
But you do not need AIR to use ByteArray ...
The code you found may use the File class. This one is AIR only.
You'll have to work that around.

Is there any way to render HTML in ActionScript3 - FlashPlayer SWF?

I already know about StageWebView and HTMLLoader, but that only works in Adobe AIR. Is there any way (maybe third party) to do the same in a SWF.
Reason:
I'm building a game in AS3 that will run on mobile devices with Adobe AIR, and there is also a web version that will run as a SWF.
The game has some links, URLs that open in a StageWebView for mobile. My problem is that the SWF has to open these URLs in a browser popup or i-frame... I don't like it :(
What you're trying to accomplish isn't possible in a SWF. However, on the web you will have access to javascript and HTML, and with that, you could replicate the functionality with an iframe that sits directly over your SWF.

Preloading external flv for FLVPlayback

I have flash actionscript 3 project that on the second frame (after the welcome screen) loads external flv into FLVPlayback component or external mp3 for player.
I'm trying to find code for preloader to the entire project - that will show before the first screen and will preload also the external files so when the user moving to the frame with the player the flv/mp3 will be shown immediately.
is it possible to load the flv into some object and then assign it to FLVPlayBack component as source?
Any help will be much appreciated!
Thanks.
You can do this by checking getBytesLoaded against getBytesTotal and creating your own loading bar, but I'd recommend using Greensocks LoaderMax library.
http://www.greensock.com/loadermax/
Lots of info and examples for you to get started.

Fancybox flash parameters

I am using fancybox within a html page and I am calling an flv file via a swf file, plays fine locally and works via the web, the problem is that I need to link all of my assets with remote urls as I need to host the html elsewhere. So html hosted on server A and assets on server B. So my thoughts turn to adding the flash parameter to the query.fancybox-1.3.4.pack.js file and this is where I get stuck.
http://www.myofficeheadset.com/video.html
I've located the object tag in the query.fancybox-1.3.4.pack.js file I just need to add the allowScriptAccess parameter
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
'"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>
Any help would be much appreciated
Justin
Using the video player within Flash usually loads the movie content dynamically from another location or file. It seems like the flash is loading perfectly fine, but it can not find the movie to load. You should make the path to this movie inside the swf an absolute path, as the relative directory changes based on where the swf is loaded into.