ActionScript 3.0 :: Load External Swf That Relies On Its Own Classes?
Jul 27, 2009
I have an external swf that relies on its own classes and functions great on its own, but when I load it into another swf, it is not working. I am getting "TypeError: Error #1006: initializer is not a function."
I am not using "root" at all, and I just want my external swf to function on its own inside the main swf file.
View 3 Replies
Similar Posts:
Dec 27, 2007
I have problem with subject. I got "undefined" message by trace() in 2 cases as well. I don't understand due to "this.createEmptyMovieClip" gives the newly created empty movieclip as well.
As the code shown below.
class CMedia extends MovieClip{
public var oOwnMovie:MovieClip;
public function CMedia()
[Code].....
Very annoying when i can not initialize a public member variable in this simple case. public var oOwnMovie:MovieClip = new MovieClip; throws error
and I could not initialize it by "createEmptyMovieClip"
how can i load external movies by classes?
View 6 Replies
Jul 29, 2010
I am trying to create a high score table offline that doesn't need php just relies on dynamic textboxes.I am basing it on a kind of random football results generator. I have been able to get the random scores and add points to a team depending on the score but now I would like to be able to display them in a 'league' table based on their points score.
View 7 Replies
Jan 5, 2012
I'm new to flash, as3 and this forum so any help would be great!I've made an xml gallery, all the movieclips and everything have been created dynamically and the images are being loaded through an xml file. Except two buttons which are in the library and have the linkage names next_btn and prev_btn.
Now what I want to do is, I have 3 categories of galleries, so I want to convert my script into a class which I can use for every type of gallery. (I hope I'm being clear)When the user clicks on gallery, a the function startGallery() is called.
I need to know how to go about it I'm pretty much clueless, I've read a WHOLE LOT of tutorials about classes but I really can't understand how to do this.
[Code]...
View 1 Replies
Feb 8, 2009
I'm having some problems with importing classes in AS3. I'm kinda new to flash and programming in general. I searched on these forums and couldn't find anything in regards to importing an external class. I'm trying to import the tweener class and I used the code: import caurina.transitions.Tweener; on the first frame of the symbol I'm trying to load the class in. But I get a syntax error and an error that says "statement must appear within on/onclipevent handler".
View 2 Replies
Jun 26, 2009
I usually lurk, but on and off over the past 2-3 months...I've been trying to solve a problem and I can't seem to find a good solution for it. Here is my problem: - I have a SWF that acts as a Shell. This shell will contain the Design Template, the functions/class calls to make it run, and a call to the external SWF that contains all the core code classes.
- My main goal for this setup is to separate the front end Design part (which can be edited and modified relatively easily) from the core code. Now the core code is something the person making the Design Template should not have to mess with. They call it and they are done; they can now use the classes for most of the functionality they will need.
- The problem is, when I change the external SWF with the core code and distribute it... the Design Template needs to be recompiled to get any updates the external SWf core code has made. I want this to be done at runtime so that the user will not have to recompile their Design Template when the core code is updated. - Now, I've seen some people talk about a runtime library... but you have to go into the IDE and set things up a certain way or something something... I don't want that. Is there a way to make all this work in actionscript?
[Code]...
View 6 Replies
Apr 2, 2010
If I have an external .as file that contains a function within a public class, how do I call it?I have succesfully used examples, but don't understand the way they are addressed, and get errors when I try to create my own.So if my .as file named external.as contains a public class named exampleClass, which contains a function named doThis(), is it called in CS4 using..
exampleClass.doThis();
or external.doThis();
If it's just exampleClass.doThis(); - how does Flash know where to look for it without
[code].....
View 1 Replies
Feb 15, 2011
if one can't communicate between mc's external classes how can you create stuff?I have a timer inside each instance form a bomber_mc via a external class:this timer places bom_mc's on the stage from the location of bomber_mc (there are several). But I want to do a do a collisiondetection test with each bom and yet another kanon_mc.can you give me a hint in the right direction?
View 14 Replies
Mar 5, 2012
I have external swf (ext.swf) that is loaded in my FlashDevelop as3 project.When I make check (objectsList[0] is Class1) I am getting false even though the objectsList[0] element is Class1. The Class1 is in the ext.swfBut when I write command like (objectListInExternalSwf[0] is Class1) in external swf and then use that swf in my project and make check (objectsList[0] is Class1)My question is: do I have to use all the classes in my external swf so the compile
View 1 Replies
Jun 23, 2010
I have a bunch of classes in an SWF file. I'd like to use them in my Flash project.[code]...
View 1 Replies
Mar 5, 2012
I have external swf (ext.swf) that is loaded in my FlashDevelop as3 project.When I make check (objectsList[0] is Class1) I am getting false even thoughthe objectsList[0] element is Class1. The Class1 is in the ext.swfBut when I write command like (objectListInExternalSwf[0] is Class1) in externalswf and then use that swf in my project and make check (objectsList[0] is Class1)I get true. My question is: do I have to use all the classes in my external swf so the compilerhave to put them in the swf so they can be used in other projects where the swf is loaded as external?
View 1 Replies
Jun 25, 2009
Here is my problem:
- I have a SWF that acts as a Shell. This shell will contain the Design Template, the functions/class calls to make it run, and a call to the external SWF that contains all the core code classes.
- My main goal for this setup is to separate the front end Design part (which can be edited and modified relatively easily) from the core code. Now the core code is something the person making the Design Template should not have to mess with. They call it and they are done; they can now use the classes for most of the functionality they will need.
- The problem is, when I change the external SWF with the core code and distribute it... the Design Template needs to be recompiled to get any updates the external SWf core code has made. I want this to be done at runtime so that the user will not have to recompile their Design Template when the core code is updated.
- Now, I've seen some people talk about a runtime library... but you have to go into the IDE and set things up a certain way or something something... I don't want that. Is there a way to make all this work in actionscript?
Additional Notes:
- Yes, it must be an external SWF. My requirements are adamant about not using an .as file.
- From my tests (though a bit fuzzy and may be flawed) an include statement will work in runtime. Correct me if I'm wrong.
- I've seen some PNG encryption method for games suggested somewhere. I haven't tried this (because encryption isn't the main goal...), but in theory, would this make the code from an updated core code external SWF refresh in realtime without recompiling the Design Template SWF file?
View 0 Replies
Feb 21, 2012
I was doing some search and it seems like it's not possible to use 2 external classes. So I was wonderinge them into one. I tried it in many different ways but it still doesn't work.I'm new to as3.This is the code I would like to merge into the next one:
Code:
public class main extends TopLevel {
var accord:accordion;
[code].....
View 3 Replies
Feb 16, 2007
let say i have this external class
Code:
class Test extends MovieClip
{
[code]....
View 2 Replies
Mar 14, 2009
Let's say you have a ton of code in your timeline but none of it is classes. Is it possible to put these into several external .as files? If so, how do you include them?
View 6 Replies
Jul 14, 2009
When I point my code to import an external classes such as:
import flash.display.*;
my understanding is that its referencing something within the flash directory to load up the display classes.
In other instances I create a "com.whatever" directory to store other classes that my code can point to.
Well I was running through the Kirupa tutorial (displaying google maps in flash) and I noticed in the code it says "import [url]..." the swf works just fine but where is it grabbing the google classes from if I didnt create the directory?
View 5 Replies
Nov 5, 2009
Translate this code to an external .as? It's a simple xml tooltip. All is done in the code but i can't figure it out how to translate it to an external .as and have a simple command to call it in whatever project i have.[code]...
View 3 Replies
Nov 1, 2009
I have a website made in actionscript 3 (the code is direcly on frames), and I am trying to load a swf that is made with external code (classes).The swf application works just fine on her one, but when I am loading it in my site it hits me with errors.
View 8 Replies
Mar 31, 2011
I'm building some website and I want to make it automatically. I load buttons and deeplinks from XML and works perfect.Possible to load classes automatically?
Even loading classes works also almost perfect.
I'm loading them from XML, but in class Menu.as I need to write them also like[code]...
View 0 Replies
Aug 26, 2010
I want to do something like this:
Code:
eval("var "+ class_iname +" = new"+class_name+"();");
But since this is not possible, how would I dynamically load different classes?
Should I use the loader class? This example does, but it requires pre compiling of the class in question + I am using AIR.: [URL]
View 1 Replies
Jul 21, 2011
I am trying to create a Bejewelled type game called BeGemmed. I created the classes for the jewels, but for some reason, Flash doesn't recognize them when I try to run the file. I get an error message that it can't find them - although they are in the current directory and are in the library. I was planning on loading the jewels into a TileList Component
View 4 Replies
Mar 21, 2010
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"));
View 3 Replies
May 20, 2011
I'm an animator by trade and don't have a ton of experience with classes or any advanced programming. Here is what I'm dealing with:
I isolated the code that I'm trying to work with so I don't have to post all the code on here because there is a ton of it. It's in two separate .as files in the same folder, BaseClass.as and Nav.as
::BaseClass.as::
package classes {[code]...........
Basically I need to put an external interface call where I'm currently tracing "THIS IS WHERE THE CODE NEEDS TO GO" that tells the external interface a new page is being loaded. I was wondering if anyone had any advice trying to get these two .as files to talk to each other.
View 1 Replies
Mar 30, 2012
importing GreenSock external classes into my flash project.
Line 27: import gs.*;
DesktopmyFlashAPPS wittersrczainu witterMainClass.as, Line 271172: Definition gs could not be found.
[Code].....
View 6 Replies
Jan 30, 2011
I'm trying to implement CSVLib in an Air application and am getting an error that seems wholly illogical to me. "1120: Access of undefined property csv." and "1120: Access of undefined property completeHandler."
The only thing I can think is it's not importing the csv class properly, or the class itself is broken somehow? I know my import path is correct because I typed it out directly based on automatic hinting. The code below is copied directly from the how-to wiki on the csv lib site.
[Code]...
View 1 Replies
Jul 7, 2009
Scenario:swf B compiles with class Vo in it and displays it's values swf A compiles with a revised version of Vo in it and loads swf B
Result:
swf B shows swf A's revised Vo class properties and not the version it got compiled with even though nobody told swf B to change it's Vo properties.
Has anyone encountered these kinds of situations? How is everyone dealing with this?
[EDIT] Since the forums still seem to be broke, you can grab my sample files here. Compile B.fla and then change class Vo version property and you'll see when you compile A that B display's the new Vo version. Link to Files
View 4 Replies
Sep 5, 2009
So I just started learning how to code in AS3 in the past few weeks and I'm having trouble finding a good tutorial or example of how I might want to attach external class files to my main .[code]...
View 1 Replies
May 9, 2010
I'm working on a game. Yep. I have the main class where I control all the stuff that's packed in external classes. My current issue is that I listen for a mouse event to happen, and when the left button is pressed, I add a child to the stage.[code]...
However, I want to set all the stats of the bullet in an external class called "Rock". In the main class I just attach a movieclip to the stage, and the behavior of this MC is supposed to be controlled by the Rock class. The problem is I dont know how to access the bullet variable from the Rock class.
View 3 Replies
Dec 8, 2010
I need to build a preloader for a swf which size is about 3MB, I tryed and tryed giving up at the end to integrate a preloader in the swf itself because it shows up only when fully loaded, no way to fix this thing, looks like if you embed fonts there's no way to stream the swf for some reason. So a moved to another way, the classical , for me, one I wrote a simple, light swf which works as preloader and I load in it the big swf, the 3MB one. Every thing works, connection to the MySQL DB is ok, parameters are passed successfully to the Java scripts etc.. the fact is when it comes to the loading of custom classes crashes brutally, the errore code is #1009, whenever I declare an instance of a custom class in the AS3 of the 3MB SWF it crashes.[code]
View 5 Replies
Oct 5, 2009
I just started to learn how to write classes, or external AS files. I have a few movies and they are receiving the same error: #1120 Access of Undefined Property. I've checked Curtis Morley, but I don't think the problem is the instance names. Since I'm adding the the movieclips with the codes. Both movies' errors occur where it contains "e.bytesLoaded / e.bytesTotal;" Does any know what's happening?[code]
View 14 Replies