Loading External Actionscript

free web hosting
Free Web Hosting > Computers & Tech > Programming > Scripting > ActionScript

Loading External Actionscript

demolaynyc
My friend and I are trying to find a way to load an .as file in a similar way to loading xml. The idea is to store an actionscript inside an xml file but it doesn't seem to work. I tried making an .as file and importing it to flash document the way it imports it is that it just places all the script in the actions panel. This is a flowchart of what we want to do:

[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]

Reply

iGuest
First of all, flash cant load external scripts dynamically, but can load at compile time. Just write the code AS in an external file (viz myScript.as) and load it by the code #include "myScript.as" (Flash simply replaces that line wwith the code frm file). Alternatively you can make an external swf which contains all ur functions in it, and call them at runtime, thus making a little dynamicity :).

-Samah

Reply

iGuest
include external .as file
Loading External Actionscript

Just do this:



#include "externalfile.As"





Note: **NO** semicolon at the end. This is for ActionScript 2.



-reply by pogo

Reply

bcarasco
But if you are using Actionscript 3 this is the way to do it
CODE
include "scripts/myscript.as"


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.

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Recent Queries:-
  1. external actionscript - 0.40 hr back. (1)
  2. actionscript import external script - 2.90 hr back. (1)
  3. import external actionscript file 2.0 - 3.12 hr back. (1)
  4. load a file actionscript - 3.73 hr back. (1)
  5. load external actionscript - 4.88 hr back. (1)
  6. actionscript 2 import external as - 5.86 hr back. (1)
Similar Topics

Keywords : loading, external, actionscript

  1. Great Website
    If you are new to actionscript, look at this website (0)
  2. How Can I Bind Dynamic Text In Flash Animation?
    i need help with actionscript (2)
    hey i want to create a flash animation for my site that can update its text every time i change the
    text in a .txt file how can i make this? Topic edited to reflect content more suitably ....

    1. Looking for loading, external, actionscript

Searching Video's for loading, external, actionscript
advertisement




Loading External Actionscript



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE