I need to create a project, in which I need to load action script from an external file that contains the script.Say for example, there is a button and the action script of the button i should some how load from an external file that contains the script.
Is it possible at all yet to have an iframe inside your SWF file that loads a website with no external code..?or what about a html parser like this: as3htmlparser.sourceforge.net .can this parser do something like im asking..? or are cross site xml policies needed for such operations..?
im trying to find a way to check an external URL for specific data, but am finding it virtually impossible because of needed cross site domain policy's..im trying to accomplish this with only internal AS3 code and no server side code..
When I try to include code from the external file "test.as" I get an error: "ActionScript 2.0 class scripts may only define class or interface constructs." "test.as" contains a simple function:
I had to use a setter...how would I implement that into my code, On my external AS file for the coin I have the following:
package { import flash.display.MovieClip import flash.events.*;[code].... And in the main movie I made a dynamic text box gave it an instance name of "score" and in my action script I wrote:
I am trying to find out how to make one .as file code interact with another .as file's code.like, if I had one .as file that specified options of movies and then when the user clicks on a movie (loaded through xml) it uses code from another .as file to load the correct movie.
Is there a way to make code on the timeline and code in a separate AS file communicate with each other?I have two buttons, a yes button and a no button.I have a confirm box which is a movie clip. In the movie clip I have the two buttons on it and code so that every time one of the buttons is clicked it runs a function.I have the rest of my code for the movie (so the code to make the confirm box appear) on a separate AS file.Is there a way I can define the functions on the movie clip and run the functions with the separate AS file?
I am trying to replace some code which loaded an external image and triggered and function once completed with code that uses and embedded image. The relevant code looks like this.
Code:
[Embed(source='globe.png')] public function Globe() { var imageLoader:Loader = new Loader();
[code]....
The commented out section is where it used to take the loaded image and apply it to a texturemap.I need to replace the lines of code in the first function with something that calls the second function correctly.
I have tried using function imageLoadComplete (e:Event = null)and calling it with imageLoadComplete(); in the first function but although it compile and runs without error, the program does not work properly. I suspect this is to do with the dispatchEvent(); line which I do not understand.
I am trying to write a class file using a .as file instead of writing code into the script tab of a .fla file.When I write stage.addChild(img); I get an error that stage is null. When I take out stage, and just write addChild(img); the code runs fine, but nothing appears on stage. Do I need to do something to set a stage active?
Is this because I don't have a Main class? My class is named after the file and I don't have a file named Main.Here is the code. As it is, it runs and I get the two trace outputs, but no graphic on my screen.
package { import flash.display.DisplayObject; import flash.display.Sprite; import flash.display.Loader; import flash.events.*; import flash.net.*; public class HelloWorldImage extends Sprite { private var background:DisplayObject, foreground:DisplayObject; private var url:String = "hw_jpg.jpg"; private var loader:Loader = new Loader( ); public function
I have trouble passing a variable from HTML to Flash.I use swf-object2.2.how to code the variable in the html-file and how to receive it in the as-file?Its a simple shopId = 110
I want to have several buttons however load a different xml file, not just use one file. Would this mean I would have to recreate the above code for every button, or is there anyway I could reuse it?
I can't seem to remove / unload the external swf files e.g when the carousel.swf (portfolio) is displayed and I press the about button the about content is overlapping the carousel (portfolio) . How can I remove / unload an external swf file from the main flash file and load a new swf file, while at the same time removing garbage collection from memory?
I have one designign query in need the code of Swf file so first i need to convert it to fla then i need a script code of it.but didnt fine it on internet.
How can I replace text loaded from an external file with text from another external file? Using setInterval and calling the .load from a function or something? In the example below I'm calling an external text file, could this also work with an .xml file with cycling through the children?
I'm having an issue running a swf within another. It seems to be running an incorrect version of the code. Here is an explanation of the environment.[code]...
this is probably a very simple mistake made by many beginners. Basically, I have a preloader loading an external swf. The external swf is an image sequence. I wrote actionscript so you can scrub through the image sequence using the keyboard arrows. This works by itself but does not work when preloaded.
Just wondering what classes I need to import into my external as fiule to make the following code work:
public static var loader:Loader = newLoader(); loader.contentLoaderInfo.addEventListener(Event.INIT, fontLoaded); loader.load(new URLRequest("font.swf"));
I created a Jing video to describe my problem. In short, I'm not sure how external AS3 scripts are supposed to referenced, though I did get it to work in AS2 years ago.
Recently, I found a great little Flash project that acts like a jukebox for external mp3 song files, and am using it on my website to play my song demos.I'm now trying to find if there is an existing solution like that for video. I just need some way to progressively download video files from my webspace when the thumbnail is clicked... and am now looking into some sort of Flash jukebox.
I've tried just embedding the video files into HTML, but they don't progressively download for some reason (even though they are saved as Progressive With Compressed Header). I've even tried using prettyPhoto (...a script that mimics a Lightbox like feature, where the whole page dims, and a floating window appears over your site, displaying any media, and allowing you to move back/forth through your list of media)..... works great, but again, not a progressive download, so you stare at a blank screen for a while.
Seems the only way it works is if I have the file on YouTube or some other site, then embed it or use the prettyPhoto app.So, can someone either tell me how to make the embedded file download (OT, but I figured I'd ask), or point at some existing Flash file that serves as a video jukebox, showing all media on a common window?
I would like to know if it is possible to load an external movie and add code with ByteArray inside, in order to add anymore properties, functions or why not Sprites?
I have a preloader that i found on the net which i am using to load my main .swf. Inside the main .swf I am loading several external .swf's and I wanted to use the same preloader to load them in.. however I am having a bit of trouble doing so.. here is the code that is attached to the preloader I am using..
Code: onClipEvent (load) { total = _root.getBytesTotal();}onClipEvent (enterFrame) { loaded = _root.getBytesLoaded(); percent = int(loaded/total*100); text = " "+percent+"%"; gotoAndStop(percent); if (loaded == total) { _root.gotoAndPlay(2); }}
When i use this preloader inside an external .swf which I am pulling into my main movie it resets the whole movie back to the begining.. i guess because of the referals to _root in the code...how I should modify this code for the preloaders in my external .swf's so I can preload and then play my exyternal .swf's in my main movie.
I was just wondering if there was a simple way to make external code files in actionscript 1.0 and then call the files into your program with a simple line of code like you can in the newer versions of actionscript.
I've got a project that I've been avoiding because it's something I've never done before. I have a concept game that I put together with internal AS3. I wasn't given much time make it work, otherwise I would have done the code externally to start.
The project is now 'go', but I want to convert the crappy internal code to external. I don't have any of those fancy IDE's. I could get one, if it would help.Does anyone know of any tutorials covering internal to external conversion? Has anyone else done this? Is there a simple list of things to convert to make the code work externally?
I am using in AS3 "External Interface ". When I call the JS function that is on the same page as swf everything works fine.
I added a link in the html page to an external JS file, when I move the JS function to the external JS file the website crushes.
I would prefer to have all my JS functions on an external file so I can use them in the future in other project and it also makes it easier for me to update the site.
how to call a JS function that is on an external file from AS3?
Structure: There is 1 main file that loads external SWF files depending on what is clicked on.One of the external SWF files loads its text from external text files. This works fine when viewing the SWF applet on its own. But when viewing as a whole site, the text doesnt appear. Very annoying.I made that particular SWF on my mums computer running Flash MX 2004The flash file itself uses the Scrollbar component from MX.Could someone tell me why the text doesnt load in this scenario? It runs fine on its own, just not as an external SWF.
I created the following code by following a tutorial, and therefore do not fully understand some of the concepts involved, just that it works. The project is complete except for one external link. The problem I am encountering is when I create the link none of my buttons work, and their hover animations all begin playing repeatedly without me even hovering over them.
When importing external swf's, would it be better to have the preloader code in the external swf or in the main movie? I've seen threads about this everywhere but I don't see the difference. Once the movie pops in it starts preloading right? Is there a faster result when the preloader is in the main movie?
I've got a file that loads 4 external swf files. I've got everything correct as far as how it's listening for when each one is finished loading and then the next one knows to play. So I can get each one to play right after the other just fine. My problem is that they don't all have the same number of frames so in between the movies, there's a blip of a previous movie showing up (atleast I think it's due to varied movie length). I want to put in a removeChild function when it's listening for each movie to finish loading. But when I put in: removeChild(myLoader);, it says myLoader is undefined..
Code: var a:Array = new Array("movie1.swf", "movie2.swf", "movie3.swf", "movie4.swf"); var iArray:Number = a.length; // number of movies var iCount:Number = 0; function manageMovies(){ loadMovie(a[0]) } [Code] .....