ActionScript 3.0 :: Comunication Between Two Classes?

Apr 30, 2009

im having some trouble comunicating between two diferent classes, what i usualy do is to setup a simple class with static object vars inside of it, and on one class with the function "function doSomething(){}" i say in its constructor StaticClass._Var1=this;
and then on every other class i just need to make StaticClass._Var1.doSomething().but this doesnt seem to be a good pratic doesnt it? how can i do this other way? i sometimes have to comunicate with more than 1 class so extending a class its not an option for me, i tried to writte this.dispatchEvent(new Event("event")); in one class and then his.addEventListener("event", appear); in another, but it doesnt go

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Comunication Between Two SWF Imported?

Oct 21, 2009

have a film with two empty MCs, "mc1" and "mc2", each one load a external swf, so far so good. The film loaded in MC1 must control an especific MC ("mc3") from the film loaded in MC2, and here is the problem. Dont work. I can�t comunicate me with mc3. Here is the code that I use:

link1_mc.addEventListener(MouseEvent.CLICK,link1cl ickPlay);
function link1clickPlay(event:MouseEvent):void {
MovieClip(parent.parent.parent).mc2.mc3.alpha=0.5;
}

View 5 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

ActionScript 3.0 :: Inheritance And Building Classes From Other Classes?

Feb 4, 2009

inheritance and building classes from other classes.

I have 3 classes:
gfxRoomText - changeable colour
gfxRomInter - changeable colour - interactive
gfxRoomImg - interactive - only image / no colour

The first two incorporate the same text field and functions to change colour. The second and third incorporate another class to interactive with. What is the best way of creating these classes using inheritance and how?

View 8 Replies

ActionScript 2.0 :: Editor - Enumerate The Elements Of Classes After Pressing "." Like Flash's Built In Classes?

Dec 21, 2005

I have to use many custom classes for a project, each class includes lots of elements(methods,properties) and I generally forget their names when coding. Is there any editor which I can enumarate the elements of my classes after pressing "." like Flash's built in classes?

View 8 Replies

ActionScript 3.0 :: Passing Classes Through Other Classes?

Nov 30, 2009

how to pass one class that holds all my math for a betting game though all my other classes that hold the pages.

View 2 Replies

ActionScript 3.0 :: How To Assign Classes And Sub Classes

Sep 15, 2011

I am new to classes and I am just starting to follow tutorials on how to assign classes and sub classes and I am wondering when you assign a base class or class to an object(Symbol e.g movieclip) through the properties, are all instances on the stage no matter how many and what they are named influenced and is the Stage/main timeline always the parent? and just one more question, is the parents objects display list all the movieclips that are used on the stage or all the instances on the stage?

View 6 Replies

ActionScript 2.0 :: Importing Classes In To AS3 Classes?

Oct 18, 2006

I am not sure how to import multiple classes into an AS3 class. Also I am bit confused on how "package" works now.[code]

View 2 Replies

Actionscript 3 :: Class - Reading All Classes Under A Package Or Reading Classes With Same Metadata

Jun 19, 2011

I am doing an Actionscript 3.0 project which involves introspection. I am wondering if there is a way to get all the classes within a given package structure.

[Code]....

View 3 Replies

ActionScript 3.0 :: Custom Base Classes And Custom Classes

Jun 25, 2009

I've created a base class to house some basic functions I'd like to have across several movie clips in a game I'm making, however, when I link a custom class to the same movie clip I get the message; "The base class will not be used because the class specified is already defined and extends its own subclass. If you wish to use the base class, specify a class name in the Class field that will be auto-generated or enter the default base class 'flash.display.MovieClip' in the Base Class field." I removed the 'extends MovieClip' inside the Class but it still shows the message. Does this mean that I cannot use a custom class and a custom base class on a movie clip?

View 2 Replies

ActionScript 3.0 :: Import Other Classes Into Main Class Or Extend Other Classes To Main Class?

Aug 1, 2011

how to get a Class file up and going in Flash and that works fine but say I want to import other classes. I try "import testCass" above in my import statements section of my as file and that doesn't work. What do I have to do to get that to work?

View 6 Replies

CS3 - Trying To Get A Grip On Classes

Aug 27, 2009

been working with AS3 for a while. not and expert but not a beginner either. Somewhere in between I guess. One thing i haven't been able to get a grip of yet is using objects with AS3, so I'm doing some tutorials and experimenting to see if I can't become a better "programmer". So to start, i made a constructor, did a few traces- simple stuff. But now I'm trying to mess with a mc on the stage. in my fla file i have on the stage an instance of a movie clip of a box called "box_mc". I've exported is for actionscript with the class name of "box" and a baseclass of flash.display.MovieClip.

[Code]....

View 3 Replies

ActionScript 3.0 :: How To Use Mx.* Classes

Feb 13, 2011

I use Flash professional CS5 and want to use Action Script3 mx.* classes but I cant find them in the "Action" tab in Flash. How can I get att the mx.* classes in the "Action"-tab?

View 5 Replies

Professional :: How To Add Classes

Jul 27, 2011

I was learning Actionscript a while back but had to stop when I came across this question. I added a class using the blank class space on the property bar on the right. After making my first class and after saving it, I exited using the 'x' on next to the class' tab. Then..... I was confused because I didn't know how to add a another new class. Where can I add or how can I add a new class

View 6 Replies

ActionScript 3.0 :: Using Classes Of The Same Name?

Feb 11, 2010

How do you import 2 classes of the same name that exist in different packages? I thought that's what namespaces are used for but I can't get it to work right. My attempt for example:

import com.packageone.CustomClass;
import com.packagetwo.CustomClass;
...
private namespace nsOne = "com.packageone";

[code]....

Am I using namespaces incorrectly or is there a different way to do this without having to write out the entire package name anytime I want to use these classes?

View 7 Replies

IDE :: How To Add Custom Classes

Apr 8, 2010

I use multiple custom classes like tweenlite, csvparse, papervision and many more. The way I do is put them in one central location and edit Flash CS4 Actionscript 3.0 settings to include that location.The problem I face is even though I don't use all the classes in a project, flash CS4 compiles every single class that is in that central location eventually increasing my compile time by minutes.

View 5 Replies

IDE :: Protect AS Classes Going Out On Cd?

Mar 17, 2011

i've got an AS3 project going out on cd. The project will consist of the SWF, several folder directories containing flvs, and folders containing ActionScript Classes used by the SWF. I'm not so much worried about protecting the FLV's or the Swf, but the cd could eventually be snagged by a rival company. is there a way to somewhat protect or encript external actionscript classes?

View 3 Replies

Any Way To Import Classes In AS File?

Jul 7, 2009

I tried to import a class in a .as file and I had strange behaviors that I cannot explain. First of, I tried to get work a senocular class by importing it locally his script in the same directory of my main .as class.

package{
import flash.display.*;
import flash.net.*;
import flash.events.*;
import duplicateDisplayObject;

There was no error returned from the compiler saying not found but there was one telling my class is still undefined as when I try to make the class work. (possibly undefined method). So I did it with the old fashion I found in some demos, placing the .as file in a com/senocular/display/ folder:

package {
import flash.display.*;
import flash.net.*;
import flash.events.*;
import com.senocular.display.duplicateDisplayObject;

And then no errors. The compiler recognize the class and execute it.

View 5 Replies

ActionScript 3.0 :: Reading Classes Cs4?

Jul 14, 2009

I have a move that reads class files located in folder called 'src' and has been working once I changed the path to absolute. for some reason now my movie has decided not to work.

this is how I create the path:Go to porperties and click 'Edit' then clicking the AS3 'settings'. I then go to the 'Source path' tab and click 'browse folder' icon to the folder of the classes.having done all this my movie still does not work.

View 7 Replies

ActionScript 3.0 :: Trying To Intercommunicate Classes With Each Other

Aug 2, 2011

I am having some trouble trying to communicate a class with another class... Here's the simple explanation: I have a main fla that loads the class Kgame through properties.

[Code]...

View 2 Replies

ActionScript 3.0 :: Classes That Refer To Each Other?

Nov 24, 2008

I'm having trouble getting classes that refer to each other to compile:

package People {
class Pairing {
var Father:Person;
var Mother:Person;

[Code]...

View 3 Replies

ActionScript 3.0 :: Importing Classes In CS3?

Jul 23, 2009

I have a project that I want to import  an external class (Caurina) I have the folder on my desktop and I'm trying to find out how to import and where in Flash do I do this. I got as far as looking for the folder in the publish settings tab (Mac)

View 3 Replies

ActionScript 3.0 :: Where To Save New Classes

Oct 22, 2009

I have tried to follow what info i could from the net, but i can't get it to work.Basically, what would appear to be a pretty cool tutorial which also lets you download the class files (i think that's what they're called), which you then import in the actionscript.The prob is that i have no idea where to save this file so that i can import it. I thought i had figured it out and tried to save it in FlashCS4>Common>FirstRun>Classes>mxI then created a sub directory called com which contained more subdirectories and then the .as file.WHen i try to import it using:import com.sub1.sub2.sub3.myNewClass;i get errors saying that the definition could not be found....

View 4 Replies

Professional :: Two Classes In A Package?

Jan 28, 2010

Apparently, I cannot have two public classes in a package. How else can I declare classes?

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 :: Use Flashvars From Different Classes?

Oct 9, 2009

In my application I often call to different web services, and because I don't want to hardcode urls to them in my code, I am passing urls to the services as flashvars.Currently I am doing it this way:

public var siteUrl:String;
public var gameId:String;
public function main():void[code]....

Where main is a function, which is called on application's creation complete event.This way I can call both variables from main file of the application but I want to access them from other files. (other as classes).So is there a way to create class with constants and init values there with flashvars so I can use them everywhere (after importing of course)

View 1 Replies







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