Welcome to AstaHost - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
Loading External Actionscript
Posted 14 November 2006 - 01:28 AM
[make an external file which contains ACTIONSCRIPTS]
[make a script that loads external file w/o pasting code into panel]
[call a function from external file]
Posted 12 November 2007 - 12:51 PM
Posted 03 July 2008 - 06:19 PM
There were many changes between Actionscript 2 to Actionscript three. One of them was getting rid of the "#" before the include directive. Including files is very useful say if you wanted to create a class in AS. It's much easier to interpert your code if you include it in a seperate AS file.
Posted 02 September 2008 - 02:06 PM
Actionscript 2.0's #include command can't include code file with class
If you do that it will generate an error on output panel.
For code file with class in it.
Just open the flash publish setting and configure the correct classpath.
And the class file will load automatically.
P.S This is only for flash 8 only. I haven't the newer version for testing.
Edited by magiccode9, 02 September 2008 - 02:09 PM.
Posted 03 February 2010 - 06:30 PM
no, PHP wouldn't work because as stated, it's used during COMPILE TIME, so as soon as you have the SWF deployed, and change the PHP (AS) file it's going to break.
You're going to want to look into data transfer options such as loading external XML, TXT or FlashVars. THose are made for things that require updating.-reply by timtom
Posted 09 February 2010 - 05:32 PM
I think that is not useful. The php file can be dynamic but I think the swf only
pulls in a include file during compile, which means you get the first php result in your compile
and it never changes until you re-compile.
Using an "eval" statement on action script that is pulled from the CDATA in an xml file
would be a solution. See this URL
I will just add that allowing users to input action script that is executed is not something I
would ever recommend under any circumstances.
-reply by mememe
Posted 23 February 2010 - 11:55 PM
I've got a swf (control.Swf) that loads an xml based slideshow swf (slideshow.Swf). I've tried simply loading slideshow.Swf into control.Swf, and it loads fine, however, the actionscript that makes the slideshow work doesn't appear to be coming along. So, I exported it and included it in control.Swf -- but it's still not playing correctly, and I am receiving no errors.
Separately, the slideshow works properly - loading in images, text, and links from an external xml
Do I need to tell control.Swf where to include the code? It should be global correct? I'm obviously doing something wrong, I've seen sites that use loadMovie to load in navigation (presumably xml based), slideshows, ect into one swf, so pieces can be worked on separately... I just can't figure out what I'm doing wrong -- most likely missing a few lines of code -- or maybe using an incorrect method.
Any and all help appreciated!-question by Codzprc
Posted 09 May 2010 - 08:29 PM
If anyone still need this. You can compile all your classes in anExternal SWF @runtime and load that external SWF dynamicaly from yourMain SWF. After you can instantiate objects that are compiled in theLoaded SWF (see the Class type in AS3 and getDefinitionByName("MyClass") where "MyClass" is can be a class defined in the exported swf.
You can have a PHP file that runs a serverside script that compiles an .AsFile into a SWF when it's called by your main SWF app.
I knowIt's a handful but it's possible. Hope it helps :).
-mihnea-reply by mihnescu
Reply to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users