Actionscript 3.0 :: Communicate Between 2 Document Classes?

Aug 31, 2010

I have 2 different swf files with their own separate document classes. My first SWF file is main.swf and it's document class is called Main.as (its the main container that loads in external swfs). The file being loaded into main.swf is called step1.swf and it's document class is called Step1.as. I have a next button in step1.swf that when clicked needs to tell the document class controlling my main.swf (ie Main.as) to load in the next external swf. However I don't know how to call a function in one document class to from another document class. And I don't know if that fact the swf calling the function being loaded into the other makes this situation more complicated. I've looked around but I cant seem to find the answer anywhere. Basically I need these two separate document classes to communicate between one another.

Here is the code for Main.as (the doc class for the container SWF):

Code: Select allpackage
{
import flash.display.*;
import flash.events.*;

[Code].....

how to get swfNavigation() to run from the other class

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Communicate Between Document Classes?

Aug 30, 2010

Let me explain the situation that has been driving me crazy the last couple of hours. I have 2 different swf files with their own separate document classes. My first SWF file is main.swf and it's document class is called Main.as (its the main container that loads in external swfs). The file being loaded into main.swf is called step1.swf and it's document class is called Step1.as. I have a next button in step1.swf that when clicked needs to tell the document class controlling my main.swf (ie Main.as) to load in the next external swf. However I don't know how to call a function in one document class to from another document class. And I don't know if that fact the swf calling the function being loaded into the other makes this situation more complicated. I've looked around but I cant seem to find the answer anywhere. Basically I need these two separate document classes to communicate between one another. Here is the code for Main.as (the doc class for the container SWF):

[Code]...

if someone can show me how to get swfNavigation() to run from the other class

View 2 Replies

ActionScript 3.0 :: Can't Communicate Between Classes

Oct 30, 2010

I'm new to as3 programming and I'm trying to communicate between two classes to get the player coordinates for a game from one class to another class. I tried using a getter and a setter and calling a class public function that returns the value.[code]...

View 3 Replies

ActionScript 3.0 :: How To Communicate Between Classes

Mar 4, 2011

How you can communicate between class's. E.g. Assessing a function from 1 class in another. And accessing variables from 1 class to another.

View 9 Replies

ActionScript 3.0 :: Classes Communicate With Each Other?

Jul 8, 2011

I am still wrapping my head around AS3 classes and how to use them..i want to know how classes can communicate with each other and send information to each other? Below I have created an example of 2 classes inside of a package. When 1 class is finished it triggers the other to start.

Code:
package
{
import flash.utils.Timer;[code]........

View 6 Replies

ActionScript 3.0 :: How To Communicate Between Classes?

Dec 4, 2009

I am trying to make a little game. In short words; you control a instance named player, and get attacked by children of the Enemy class.How can all the children of "Enemy" know the coordinates to player instance, how can the document class and the Enemy class exchange variables?

View 14 Replies

ActionScript 3.0 :: Can't Communicate Between Mc's External Classes

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

ActionScript 3.0 :: Basic Way To Communicate Through Different Classes?

Jul 3, 2011

I've had C# lessons in class and saw some basic class functions. Now however it's been a while since I worked with AS3. And it seems I can't figure out a basic way to communicate through different classes. I'd hoped I could do something like level.backgr1.x += 5; Where backgr1 is a MC defined in the class Level. I'll explain the thing I want to accomplish. I have a 3 classes, Main, Player and Level. Player and Level are children of Main. the mc in Level needs to move when a keyboard event occurs in Player. But only Main can acces Level because it is it parent.

View 2 Replies

ActionScript 3.0 :: Communicate Between Two Movieclip Classes?

Oct 21, 2011

I have a question that doesn't seemt too complex, but I am unable to find the answer probably because I don't know what to search for.

I just don't understand how to communicate between two movieclip classes.[code]...

View 5 Replies

ActionScript 3.0 :: Communicate Between Custom Classes?

Jun 26, 2008

I've started to work with Actionscript 3.0 for a couple of weeks and I've just started my very first "top-to-bottom" AS3 project which I'll be delivering (a "demo") next Monday.However, some basic complications are arising and I just don't know what to do, this probably has been answered a lot of times but I can't seem to find a single blogpost/forum/website that addresses this issue in a way that I can understand instead of "copy/pasting" code.[code]Ok, when I press a button inside the NavBar class I want it to execute a function that tells the DocumentSetup generated MovieClip(contentLoader) to load in a different SWF based on the arguments passed on the Event.My questions are:

1 - How do I access a public function on a different class? Let's say I have my navFunction() placed on the DocumentSetup Class, do I need to create "another" instance of the DocumentSetup Class just to tell it to do something?

2 - Let's say you're able to explain to me how to solve the problem above.How can I reference a MovieClip generated by the DocumentClass through another Class? I need something to tell the contentLoader MovieClip to change contents, how do I communicate with it from another Class if the MovieClip was added to the DisplayList through code on the DocumentClass?

3 - How can I create a Variable which is identified throughout the website, let's say I have an XML file with all the text content that's going to fill in the content placeholder's. How do I make this XML data accessible from all classes instead of having to re-import the XML again and again?

My external classes all work 100% themselves but I cannot get them to communicate with each other, I keep getting compiler errors...A website in which you can't navigate to a different page is basically useless

View 14 Replies

ActionScript 3.0 :: Communicate Functions In Different Classes?

Mar 13, 2009

I have 2 classes

Code:
package com.MyClass.basics1
{
//importing classes to use[code]...

Is there any other way to reference a function ?

View 3 Replies

Actionscript 3 :: Communicate With Server-side Script - Only In Document Class Or In Sub-class?

Mar 14, 2012

Say i need to send some data from AS 3.0 to a server-side script for it to do some actions. Can I do this in a sub-class called some where in a document class or should we always do it in a document class?

View 1 Replies

Actionscript 3.0 :: Preload The .swf Itself Using Document Classes?

Mar 24, 2009

I'm trying to go from inline scripting to document class, and having a very hard time going there..! at the moment I'm trying to preload my flash/swf'en, when loading it in html.

I've managed to do it inline style,check out an example here

this flash has 2 layers, a script layer and a content layer. each layer has 2 frames. in the first layer I have this code:

Code: Select allimport IndexPreloader;   
var _indexPreloader:IndexPreloader = new IndexPreloader();
setupPreloader();
function setupPreloader():void {

[Code].....

when using this setup, it's as if all the content of the .swf is loaded before the preloaderen is started.. so the preloader has nothing left to preload and starts and stops almost at once.

View 4 Replies

ActionScript 3.0 :: Importing Classes Without Using Document Class

Feb 2, 2011

I have 2 as3 files, which are the classes used . I have to use it with the main flash movie.. How will I include those as3 files without using document class..

View 4 Replies

Actionscript 3.0 :: Document Classes And Multiple Scenes?

Sep 2, 2010

I've been searching the internet for how to use scenes in flash games, and from what I understand it got some problems? MY problem is that i cant really understand what the problem is and I cant find i "clean" explanation.

Some say you dont should use scenes in game development, some say you should?? Im confused.

Another thing that i dont understand quite is the document classes. Should i have one document class for every scene or one for all of them?

If i have 2 scenes with it's own document classes, how do i switch between them?

View 4 Replies

ActionScript 3.0 :: Document Classes And Library Instances

Jul 14, 2009

1. I've got a Main Document class, that loads external swf each with its own document class (they are pages and pieces of the site).

2. The Main class makes use of some movieclip simply instantiated from the GUI library. It all goes fine.

3. The external swf have references to the Main class, and here start problems: when I compile them, I get an error for every library mclip used by Main. See the attachment. A simple trace(Main) is enough to start getting all that errors.

A partial solution is to uncheck Strict Mode in publish settings

View 10 Replies

ActionScript 3.0 :: Accessing AS Classes In A MXML Document?

Sep 21, 2009

how to put actionscript classes into an MXML document? Lets say my class represents a movieclip, a rotating triangle for instance. How do i put that into a <mx:vbox> containter? I can do the AS work in a <mx:Script> tag, but how do i embed my class instance?

View 2 Replies

ActionScript 3.0 :: Document Classes And Multiple Scenes

Sep 2, 2010

I've been searching the internet for how to use scenes in flash games, and from what I understand it got some problems? MY problem is that i cant really understand what the problem is and I cant find i "clean" explanation.Some say you dont should use scenes in game development, some say you should?? Im confused.Another thing that i dont understand quite is the document classes. Should i have one document class for every scene or one for all of them?

View 1 Replies

ActionScript 3.0 :: Access Vars Between Document Class And Other Classes?

Apr 19, 2009

For the example, there's a single FLA with a document class "main.as." In the public class main.as package, there is a public variable: "var example:String='example';." Inside of the FLA, there is one movie clip in the library and it is assigned a custom base class "sub.as." The movie clip is then placed on the first frame of the stage so its constructor is run at runtime and reads the value of example.

What is the proper way to get the value of "example" in the root document class? Using "root.example" in the sub.as class to target the document class returns an error and when I trace "root", I get "null." Main.example naturally throws an error because that's looking at the actual class and not the movie / stage its attached to.The round-about way I've done it before is to dynamically add the object in the library and pass in the root path when I create a new instance of it (example: submc:sub = new sub(this); ).Is there anyway to get back to the document class with a built-in method like root, etc?

View 2 Replies

ActionScript 3.0 :: Import Classes Without Declaring A Document Class?

Sep 25, 2009

The header says it all. I am trying to import a couple of classes without attaching a document class to the fla file. Is this possible? I have the class path set as appropriate (I think) in the publish settings since my fla is located inside a swf folder and my classes folder is located outside the swf folder. Its how my project is organized.

Class path set: "..classes"

View 8 Replies

ActionScript 3.0 :: Loading External Classes Into Document Class?

Sep 7, 2010

I am trying to load external classes into a document class and initialize the page by loading one of them (which loads xml and videos) I feel like I should be able to do this but have not found documentation on this. Below is the code i am using...

package {
import flash.display.MovieClip;
import flash.net.URLLoader;

[code]....

View 1 Replies

ActionScript 3.0 :: Document Classes And Nested MCs - Term Undefined

Jan 6, 2012

I am trying to create a gallery. I am having a problem coding the document class for a menu window ("galleryPane"), which is to be called into the Main class at runtime. In particular, I am encountering problems dynamically creating the thumbs container. I want the thumbs container to be accessible from both the galleryPane class and the Main gallery class [the galleryPane class will need to control thumbsContainer scrolling properties, and the Main class will load content into it].

I have an empty movieclip in the .fla library (with a class name of "All_thumbs" for exporting purposes). In my galleryPane class, I have created a new public instance of this (called "thumbsContainer") and have added that within the nested structure in the menu. However, when I call it in a later function to manipulate its movement, the undefined term error is thrown and I cannot understand why. Here is what I have in the galleryPane document class.

ActionScript Code:
package  {
import flash.display.MovieClip;
import flash.display.SimpleButton;
import flash.events.MouseEvent;
import flash.events.Event;
[Code] .....

View 2 Replies

Actionscript 3.0 :: Make Non-document-class Classes Aware Of Stage Comp?

Dec 2, 2010

I am working on text adventure game which will have at least a few components (a text area for narrative and text input for user input) on the stage at all times. Therefore, I have created those components statically through Flash's WYSIWYG design environment. I gave them instance names "myTA" and "myTI" respectively. I was able to get my main class (the document class for the stage) to interact with them (dynamically adding text one character at a time like a typewriter at runtime), but other classes in the same package don't seem able to recognize the stage components. Below is the relevant code:

Case A, in which everything happens within the Main class:
Code: Select allpackage {
public class Main extends MovieClip {

[code].....

View 1 Replies

Actionscript 3 :: Make Non-document-class Classes 'aware' Of Stage Components In Flash?

Dec 2, 2010

I am working on a text adventure game which will have at least a few components (a text area for narrative and text input for user input) on the stage at all times. Therefore, I have created those components statically through Flash's WYSIWYG design environment. I gave them instance names "myTA" and "myTI" respectively. I was able to get my main class (the document class for the stage) to interact with them (dynamically adding text one character at a time like a typewriter at runtime), but other classes in the same package don't seem able to recognize the stage components. Below is the relevant [code]...

View 5 Replies

ActionScript 3.0 :: Stylemanager - Set The Style Of Another Document From It's Parent Document?

Dec 15, 2009

Can I set the style of another document from it's parent document? At the moment its giving me the error 1119: Access of possibly undefined property StyleManager through a reference with static type DesignCardForm.

View 2 Replies

Auto-import As3 Classes (internal/intrinsic Flash Player Classes At Least) Using Emacs?

Aug 23, 2011

Is there any way to auto-import as3 classes (internal/intrinsic Flash Player classes at least) using Emacs ?

Looked for as3-mode and actionscript-mode but nothing working was found. as3-mode can import class if it is opened in buffer (but not *.mxml files)

View 1 Replies

ActionScript 3.0 :: Unexpected Errors, Multiple Helper Classes, Extended Classes?

Jan 9, 2010

The examples I'll use don't do anything - they're classes without ANY members - no variables, methods, anything.

Let's say I extends Sprite and call it MySprite.

I save it in test.core

[code]...

Now I create another custom class called MyWindow that extends MySprite.

I save it in test.windows

[code]...

Then I create another class that extends MyWindows (the example I'll use is a document class - but that doesn't matter - I've tested using an instance too).

[code]...

Notice that I'm not even trying to instantiate the helper classes - just having them there throws the error.

If there is only a single helper class, everything runs fine.

Also note that - as far as I can tell - this only happens when extending one class from another package, then extending that class with more than one helper object.I'm pretty sure there's no namespace bumps or typographical errors, as this is a very pared-down version of the original application.

EDIT: seems the problem exists even without the crossing packages - even extending MySprite in the document class with multiple internal classes generates this error.

View 4 Replies

Actionscript 3 :: Inside The Library Use Of A Bunch Of Classes/packages - Expose One Of These Classes?

Feb 3, 2012

I am creating a library in AS3. Inside the library I make use of a bunch of classes/packages that need not be exposed to the end user of my lib. I want to only expose one of these classes.

I guess my questions are:

1) How are libraries commonly distributed in AS3?

2) Is there a .jar equivalent in AS3 that developers can include, but will only have access/knowledge of the classes I've declared as public?

View 2 Replies

Actionscript 3 :: Classes In Project Override Classes In A Flash CS3 SWC File?

May 6, 2011

I have an actionscript project which uses visual symbols from an SWC. I have a CheckoutButton which has the following class associated with it (compiled into the SWC in Flash CS3).

[Code]...

View 1 Replies

ActionScript 3.0 :: Protocol For Importing Classes From Sub Classes?

Feb 8, 2011

I'm trying to import a class from a class that is located in another folder. How do you move up a directory? Using./ or ../ doesn't seem to work. Essentially I want to access a TweenLite Class but not from the document class. My class is at com/myName and the class I want to access is at com/TweenLite. import ../TweenLite doesn't work... I realize I could just copy and paste the entire Tweenlite folder again, but there's got to be a less duplicative way of doing this..

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved