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
Similar Posts:
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
May 25, 2010
We are developing a Flash application based on Windows CE 6.0 R3 and the application is intended to work with Adobe flash plug in available in WinCE R3 Internet Explorer. Application need to communicate with middleware libraries written in C/C++. Flash screens uses Action Script 3.0. We would like to know how a Flash application (Action script program) can communicate with a native (C/C++) dll/lib?
View 1 Replies
Mar 18, 2011
Is there any way I can have an integration between Flash AS and C++? Let's say I have created a socket using C++ and multi-casting it to several ip addresses.
On one of the IPs I am running a Flash client. Can I receive the Multicast message (sent by MFC/C++ application) through my Flash application.
Or at least can I develop a Flash plugin (menu item) using C++?
View 1 Replies
Feb 18, 2009
The Flash site I am building includes an FLV video which is embedded into a SWF (SWF1),which contains the video control components. SWF1 is in turn loaded into another SWF (SWF2) after SWF2 is launched. After I leave the part of SWF2 which contains the video, the video and audio continue to play. You can still hear the audio after you have moved away from the SWF1 video.The SWF1 video is part of a set of mostly PNG images that slide like a slide show along the X axis. When I hit the forward arrow, the SWF1 video slides out to the left and a loaded PNG image slides in from the right and into view. But you still hear the audio from SWF1 and the video continues to play.All of the loaded SWF video (there are three total) and PNG images are loaded into the same movie clip.Question: How can I tell the FLV video embedded in SWF1 to stop playing once SWF1 has moved out of view? I would like SWF2 to tell SWF1 to stop the video.
View 2 Replies
Feb 28, 2009
I'm working on a game where the the engine is made in AS3, yet the interface is made in AS2. Basically I am embedding the GUI as a AS2 .swf into my main AS3 .swf. I want the AS2 GUI to be able to communicate with it's parent. Small Interface calls like Pause, Unpause, Upgrade.I tried to use External Interface, but I can't seem to get it to work. I know it's made for Javascript, but I thought that it would work just as well with AS2 to AS3.I'm able to edit the Interface file and have the FLA for it. It'd just be a real pain converting it... It'd take way to long to convert the FLA to AS3, talking weeks here, it's rather large.
View 3 Replies
Apr 23, 2009
I'm having a little issue with LocalConnection - trying to communicate from one SWF to another. From my main SWF I've loaded an external SWF of same dimensions ( effectively replacing the main SWF). What I wanted was then to re-load the main SWF, but rather than have the main SWF play from the start, I wanted to go to a specific frame instead (I used a frame label called "myMarker"). Thought LocalConnection was the way to go to achieve this. Gave it a shot and it all works well locally BUT when uploaded to server it doesn't work, but throws the following error:-
[Code]..
View 1 Replies
Mar 12, 2009
I have a large.swf that loads small.swf during the runtime. How do I call a function in small.swf from large.swf and vice-versa?
View 4 Replies
Aug 5, 2009
I was able to use LocalConnection to have 2 swfs communicating when both sitting in the same PC, or upload those on to the server and accessing those from the same PC. Is there any way to do this between two PCs, one PC running send.swf, controlling another PC running receive.swf? I checked adobe site for LocalConnection and it looks like this only works within one client PC.
View 2 Replies
Dec 18, 2009
I have written a flash program using AS3 which allows the user to build a picture of a product using a variety of options displayed in checkboxes. Very simply these checkboxes either make a layer visible or invisible in my flash movie and certain choices may change the list of options. This information is currently being supplied by XML. Once the user has built his product, I would like to be able to save his choices in a SQL Server database and also be able to download his options again at a later date and view these choices at the manufacturing plant.
So far I have tried using asp.net to write to the database and have got the information to the asp.net program by using the querystring, however there may be up to 50 options which does make a querystring rather unwieldy. Also I cannot seem to send back information from the asp.net page to my actionscript.Can anyone tell me how to do this or give me an example? I am supposing that I use the response.write function in asp.net but what command in AS3?I looked into the possibility of using a webservice but see that AS3 no longer supports this as all the functionality is in Flex. I have read about Flex but still do not understand whether
View 1 Replies
Jul 9, 2009
What is the best way for flex frontend to communicate with backend writted in C#? The only communication channel in HTTP, so no custom sockets.I used SOAP in the past, but am concerned about performance since the large overhead of xml, and this application I'm currently working on will be pretty data intensive.Anything that supports easy setup and transparent marshaling/unmarshaling is OK.Is there something as BlazeDS for .net?
View 2 Replies