ActionScript 3.0 :: Talking To External SWF Doc Class?
Jun 11, 2009
I have a file structure similar to the following:
LoadingSWF
LoadingSWFDocClass
ContentSWF
ContentSWFDocClass
In my ContentSWFDocClass I reference library elements that were "exported for actionscript", so they only exist in the ContentSWF. The ContentSWF compiles fine because my ContentSWFDocClass can find all the resources in the library....
The problem is that I need my LoadingSWFDocClass to talk to my ContentSWFDocClass. However, when I try to include a variable (or make any reference to something) of type ContentSWFDocClass in my LoadingSWFDocClass I get a compile error because the compiler doesn't recognize the library symbols that ContentSWFDocClass is referencing.
How can I get around this? I really need to reference elements in the library in my ContentSWFDocClass, and I also really need to be able to send commands from my LoadingSWFDocClass to my ContentSWFDocClass.
View 2 Replies
Similar Posts:
Aug 27, 2010
Now I am trying to another very simple thing.
In my main time line I have:
var _side = new Side();
var _main = new Main();
I have Main.as and Side.as saved in the same folder as Main.fla.
Here is Main.as
ActionScript Code:
class Main {
public function Main(){
[Code]....
Now the Main.as knows nothing of the variables speed and velocity. Is there a way to reference back and forth? Say for instance I have a dog class that drinks water from the water class.
If it rains then the water class changes var Water from 4 to 8; When the dog drink the water he can drink until the water is gone, but how the water variable was changed in the water class not the dog class.
View 2 Replies
Mar 25, 2010
I have a Main.fla which loads Main.as as its document class. In Main.as I have a public function named "Main" which runs a trace. I also have another .as file called Preloader.as, which also has a public function in it, this one named "Preloader" with simple trace in it. I just cannot figure out how to use Preloader() from the Preloader class in Main() from the Main class. Main.as loads up fine when the SWF loads and traces.
View 10 Replies
Aug 1, 2008
I have a SWF file that I call the a parent, it imports a number of SWF(children) which I can switch through. is it possible to have a function in the parent SWF that the child SWF can launch?
The reason I need this is because each child SWF is a sort of small game, so when each game is finished I need some kind of way to let the parent SWF know that the player can continue.
View 9 Replies
Aug 13, 2009
im trying find out a value of a var from a mc called from an eventlistener.
//////////// as2 oldSchool ////////////
function loadPlayer() {
trace("myScene: "+this.myScene)
[code]...
View 3 Replies
Aug 24, 2009
i can make Flash execute JavaScript functions, but I don't know how to communicate to flash with javascript. For example, I have a flash header with an XHTML body. When link is clicked in the body, I need the flash header to move to a new frame. The frame is dependent on the link.
View 1 Replies
Aug 28, 2009
i'm still in the process of grasping my move from AS2 to AS3 (or from timeline coding to external classes), and here's a problem i've run into.i have two classes, for the sake of easiness, call them Class1 and Class2.in frame 1, if i have
ActionScript Code:
var c1:Class1 = new Class1();
var c2:Class2 = new Class2();
[code]....
View 4 Replies
Jan 1, 2011
can download animated talking characters for flash? I like to create a presentation which has an animated character similar to this -I was able to find (google) several tutorials for creating animated characters, but I'm not really good at drawing avatars, so now I'm looking to download one (a .fla file)
View 2 Replies
Mar 17, 2011
I am building a quiz using XML for the questions and a ButtonTopLevel class to control the behaviour of the buttons tasked with choosing a question. Basically, the docClass imports the XML, makes sure it is fully loaded and then adds these top level buttons as children. I need to maintain the MouseEvent.CLICK in the button class because once the button has been used, it will switch to feedback mode and no longer be available as a button. Once clicked, the button says:
[Code]....
I have a sort of "go back" button in during development, and if I go back to the top level buttons and click any one of them, it works as it should. There is nothing undefined, with the possible exception of a variable or two I've declared and not yet used. Is it something in the way I'm telling the child to talk to its parent? My code is rather lengthy, but I will post if need be - just hoping it might be something I'm missing in this call to the parent.
View 2 Replies
Dec 10, 2009
Currently I have a flash based application (game) which I need to put on facebook, the users could save their scores and resume their game. For the task I was wondering which scripting language would be appropriate. And are there any API's available which could in the process. Or does one has to make all of it from scratch.
View 1 Replies
Sep 21, 2009
I've got a container swf that loads a few content swfs... now what I'm trying to do is get those content swfs talking to each other (the site is [URL], where the home slideshow, work and firm sections are each separate flash files). Specifically, I'm trying to get buttons on the home slideshow to link to their respective projects in the work section.
I've got home.swf dispatching a custom NavigationEvent when a button is clicked, with the clicked project's id attached to it. My index.swf catches the event, but this is where I'm stuck. I can't get it talking to work.swf. As far as index is concerned work.swf is an instance of Loader, and doesn't have the functions I'm trying to call. Right now the functions are on the timeline on frame 1. Do I have to move all the AS in work.swf into a document class and implement an interface that I can use to cast the Loader in index.swf?
View 1 Replies
Sep 27, 2004
Basically I am trying to get buttons that I have in a drop down menu load an external .swf into an empty movie clip placed on the main timeline. However for some reason it is not working. The buttons are contained in a movie called "menuItems" which is then placed in a movieclip called "mainMenu" which is then placed on the main timeline.
on (release) {
_parent.gotoAndPlay("reverse");
if (_root._root._root.currMovie == undefined) {
_root._root._root.currMovie = "personalData";
[Code].....
View 3 Replies
Jul 22, 2009
I'm trying to create a new instance of a MovieClip when the original one has been used. Would sound easy enough. Just use: var
instanceName:ClassName = new ClassName();
the class name/mc in the library im trying to duplicate is MCg1 so
var instanceName:MCg1 = new MCg1(); right?
However, the particular object in the library i'm trying to duplicate has a base class that is an external class file (just to control it's drag drop functionality)... i.e baseclass is not set to the standard flash.display.MovieClip, or whatever the case maybe. So i end out with a: TypeError: Error #1009: Cannot access a property or method of a null object reference.
View 6 Replies
Oct 22, 2011
I am trying to access a function in a loaded swf that has external class.. I would like to avoid having to put the function on my "Main" Doc class in the external swf and instead access the function directly from the class
This is what ive tried so far and it's a no dice:
private function startLoad(){
var loader:Loader = new Loader();
var req:URLRequest = new URLRequest("one.swf");
[Code]....
View 1 Replies
Jun 27, 2009
Lets say I have Main.swf and sub.swf, and I wanna load sub when I press a button from Main, but sub.swf has its own external class file attached, so here is the problem, when I load sub using loader class and I would get this message from the output panel:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at subScript()
seems loader class can not access sub.swf's external class when sub is being loaded.
View 1 Replies
Jan 5, 2011
I have seen that some websites offer talking characters (very human looking avatars), but I do not want to pay HUGE money for those. So I started thinking about some of the cartoons I used to watch and if there was a talking computer, their way of visually portraying speech was with an equalizer.
For the "robot", I would just have 2 dots for the eyes, a nose, and a "mouth", but this mouth would really be an equalizer, and I could animate that with flash so that when there is loud sound, the mouth would open wider than it would for a soft sound ( if you watch an equalizer, the bars go way up and turn red when the music is loud, and remain low and green when sound is soft )
The only web technology that I imagine could do such a thing is flash, but I know very very little flash. I have been searching and searching and searching and all of the equalizer tutorials I have found are just bars with random movements that do not sync with the audio.
View 1 Replies
Dec 9, 2010
I am a US Marine and I am trying to help my shop out by building a program that would allow me to maintain records of gear so we do not have to count millions of pieces of gear everyday. So i built a database:
[Code]...
View 2 Replies
Oct 12, 2004
I am doing a site with a top flash nav, and Iframe with some flash and html in it.Is there a way to have the flash in the Iframe give actions to the flash nav??when you hit the porperties button, i want the nav to change to FOR SALE.something like:
on (release) {
_level0.clip.gotoAndPlay(2);
}
View 1 Replies
Feb 15, 2011
I'm trying to call an external API which returns XML, and i have no problem doing that.
Afterwards I wanted to refactor my code, and I moved my API call to an external API.as class, but how do i return the XML to my main class?[code]...
View 4 Replies
Sep 29, 2010
I have created an SWFloader class that creates a container on the stage and loads an external swf into it. How can I click a hotspot in the external swf and make it instruct the loader class to load a new external swf? Basically, how can I access the SWFloader class from the timeline of the external swf?
View 1 Replies
Mar 31, 2009
I'm using the tweener class in this file just fine. But whenI try to use the sound manager class I cannot get it to load why?I keep getting type was not found ....
import com.richardsongraphics.soundmanager;
var manager:SoundManager = new SoundManager();
=======================================
[code].....
View 2 Replies
Oct 26, 2009
I am creating a Flash form which will include a drop-down selection menu from which a user may choose their state. I originally accomplished this by adding a ComboBox to the stage and then populated the ComboBox's DataProvider object with an XML listing of all the state names and the corresponding values. Everything works as expected.I have decided, however, that it would make the most sense to create an external class to accomplish the same thing. I have attempted to create such a class using the following code:
package {
import fl.data.DataProvider;
import fl.controls.ComboBox;[code]....
I am new to creating external class files so I am not sure why the new object is not populated with any data.
View 3 Replies
Jun 14, 2010
I found some code that let's you load variables from an external swf. I'm trying to adapt it so that I can use the symbols from external swf library in my main swf. I get an error telling me 'call to an undefined method...' and then the name of the symbol I am trying to import to the main swf (testMe123_MC). Here's the code of my external swf as:
[Code]...
View 1 Replies
Jul 31, 2011
package
{
public class TimeDate
[code]........
View 16 Replies
Mar 12, 2012
For my Flash class, my professor is making us create a four room "adventure game" created entirely in an external class with ActionScript. I know how to get things set up,
View 1 Replies
Oct 28, 2009
I was chatting with my buddy about this, he is convinced you can do this and says he has done it, but I cannot get this to work.
I am wondering if it is even possible at all. I tried typing a var as a Class that is within the externally downloaded SWF and then making an instance but no can do.
some code
private static function onCompleteHandler(e:Event)
{
dashboardObject = e.target.content;
// registerClassAlias("Dashboard", ); doesnt work
[Code]....
So it seems you cannot make an instance of a class unless it is complied within the project SWF. Which if true is what I want it to do. I do not want people trying to make instances of my classes just from downloading the SWF file for what I am building here.
View 5 Replies
Mar 19, 2012
I have this cool As3 MP3pitch package, which I got from here:
package components
{
import flash.events.Event;
[code].....
View 2 Replies
Feb 11, 2009
How do we create a class file and use it in seperate flash file
View 0 Replies
Dec 3, 2009
I am having trouble having an external Class detect when it collides with an object that I have added to main stage. I have physically placed a MovieClip to the stage and given it the instance name of "hitZone_left". When I publish the files I get the error: "Access of undefined property hitZone_left".
Code:
package flash
{
import com.caurina.transitions.*;
[code]....
View 1 Replies
Dec 18, 2010
I have encountered a problem loading an external swf in my application. The external swf file is using a class and when I load it in my other flash it didnt load I think the class have a problem!!. I use the flash.system.ApplicationDomain and LoaderContext. It didn't have no effect in the my flash program.
View 0 Replies