ActionScript 2.0 :: Classes Talking To Each Other

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


Similar Posts:


ActionScript 3.0 :: Custom Classes Talking To Each Other?

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

ActionScript 3.0 :: Intermittent Error Talking Between Classes

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

ActionScript 3.0 :: Child Swf Talking To Parent SWF?

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

ActionScript 3.0 :: Talking To MovieClips From EventListeners?

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

ActionScript 2.0 :: Talking To Flash Via Javascript?

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

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

Animation - Flash: Talking Animated Characters?

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

What Is The Recommended Scripting Language For Talking Between Flash And Facebook API

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

Actionscript 3.0 :: Prototype - Interface - Get Content Swfs Talking To Each Other?

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

ActionScript 2.0 :: Nested Buttons Not Talking To Main Timeline?

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

Dynamic :: Make A "robot" Appear To Be Talking On Website?

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

ActionScript 3.0 :: Flash Talking Between A MYSQL Database And FLASH With XML And PHP

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

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 :: Talking From Iframe To Iframe?

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

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







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