Flex Swfloader with a swf which loads another swf file - apache-flex

I have one Swfloader. This swfloader loads file A.swf.
On creationComplete event, File A.swf loads another swf(file B.swf).
Everything works fine when I run the application once in the same machine.
But when I run two or more instance of the application, the first works fine (both file A and B are loaded) but the second swf (file B) is not loaded by file A.
Could you please help me to find out why the first swf (file A) doesn't load file B, when the application is running in multiple instance ?
Thank you in advance,
Casey

That's weird. There could be a few explanations. First off, have you tried debugging your problem? It could be something to do with browser caching. I would look at your developer console (included with Chrome, ctrl+shift+i, or use Firebug extension with Firefox) in the Net panel to see if it's loading the new swf properly or not.
Are the swf being loaded dynamically with data or is it static (b.swf never changes). There are too many things to take into consideration here, but it could be that there's an error that happening and it's not loading b.swf. Do you have Flash Player debug installed?

Related

Injected code in *.ASPX.VB file at pre-build event is not compiled, have to compile twice, why?

I have a pre-build event in a web project in Visual Studio (2012 but same behaviour in 2010).
The prebuild invoke a simple exe which look for every filename.aspx.vb file if there is a matching filename.html in the folder.
If it does, it just read the filename.html as a string (escaped and minified) and inject it as a string also in the finename.aspx.vb something like :
myStribBuilder.Append("This is where the html code from the external file is going")
Let say i made a modification on filename.html I save and I compile and test the website. It should reflect the latest change when calling filename.aspx
Here what happens :
If I have a very light project with one page or two, it does work. It compiles fine as expected.
Then project get bigger and it doesn't work anymore. I mean code is injected but not compiled as expected, if I refresh filename.aspx on webserver I will still have same version but if I open filename.aspx.vb on VS the code is in there. Second compilation works 100% ok.
I can live with that but I have to compile TWICE each time for testing purpose after html files changes.
This doesn't make sense to me.
What "pre-build" means if in fact it seems to cache the code right on compilation request before executing the prebuild routine.
So, how can I be sure to inject code in my *.vb file before compilation begins ?
I figured out the problem was not VS not waiting for exe to complete on prebuild, but rather having the filename.aspx.vb opened when compiling.
The code update itself on the IDE (with options set to autoupdate externally modified opened page) but I guess the compile process keep the pre-build version of the opened file, which make sense in a way.
If I close the file before compiling it is ok.
Now I wonder if there is a workaround to this, but I understand it is not common practice to externally modify on the fly opened files in IDE before compilation. I do however rely heavily on this technique.

RSL used in FLEX

How to use RSL(Runtime shared library) in flex ?
how can decrease loading time of swf using rsl?
please give answer
The SDK default setting of the project is RSL.
check here Goto Project->Properties choose the Library path from the tab where you can see the framework linkage.
The thing is It is one of the way to reduce the size of the application and the library files are downloaded and saved to cache file in browsers. so when you run the application again, the library files are taken from the browser cache.so the loading makes faster than the first time.It continues until the cache is cleared from the browser. for more information refer here.

Problem While swf embedding in Flex

A problem that is waste my one hour
I am embedding swf in the flex application it works fine.
But when i embed one swf the compiler through an error
unable to resolve 'com/assets/swf/flash_ad.swf' for transcoding
Unable to transcode com/assets/swf/flash_ad.swf.
pls help me.
Actually that swf is compiled and published in older version of action script.
So when i de-compile the swf and generate my own swf with latest version of action script the problem is gone.
Anyway Thanks
Make sure your flex compiler is able to locate the swf first. Try refreshing your workspace, so compiler finds it.
Also ensure your swf is built correctly. Corrupted swf's wont get embedded.
Check if this helps: http://www.brightworks.com/flex_ability/?p=38

Why does Flash Builder 4 use Flash Player instead of a browser to run apps?

I've got an old flex builder 3 project that I imported into Flash Builder 4, and I want this project to run its web applications in my web browser. However, the apps persistently run in the Flash Player instead. This is causing no end of problems because of the flash player bug documented at https://bugs.adobe.com/jira/browse/FP-209.
How can I make a project's apps run in the browser instead of the player?
This issue can be caused by HTML generation being disabled. In the project property panel:
Screen Shot of the settings http://img685.imageshack.us/img685/1487/screenshot20100422at124.png
In your debug configurations, make sure that the url or path to launch points to the html file that the swf is embeded in, not the swf itself. You can reach the debug configuration menu by clicking the little arrow next to the debug bug icon... (and probably some other way, but i always use that menu).

Why my flex application can not compile sometimes?

Sometimes when I compile my flex app, I got this error
Unable to create source GeneratedAsset31_dataClass. WebCe line 25 1259045578886 1546
But after I cleaned the project, this error disappeared.
It's not a big problem but very annoying and I can not find any clue by search the internet.
Any suggestion?
Your compiled and "generated" .swf file may have been opened in another application while Flex Builder was trying to re-compile or inject code changes back into the .swf.
If that is the case, you can solve the problem and avoid the error by closing the applications that have opened the .swf file before you switch back to Flex Builder and start coding again.
Please note that if you are developing an AIR application you should close the AIR app, or if you are working on a web application close the stand alone flash player if you are testing your app that way.
Web browsers like Firefox, Internet Explorer or Safari are an exception because they don't lock open files and Flex Builder is able to re-compile even though your application is running in the browser, of course you will need to hit refresh in your browser to see any further changes.

Resources