ActionScript 3.0 :: Flash Communicating Between Two Classes?
Apr 21, 2011
I have a custom keyboard class. The second class is having a textBox as its child and my custom keyboard's object as child. When the key in the custom keyboard is clicked, how can i update the value in the text box?
View 4 Replies
Similar Posts:
Jan 26, 2009
I'm trying to call a function from a class that I've instantiated on the main timeline from another class that I've also instantiated on the timeline.The function I'm trying to call adds a line to a string that acts as a game terminal so that even if the game glitches for someone without the source code, it would be possible to read the variable changes and functions called. (it also doubles up as an input for unlocking characters and levels that are otherwise hidden)Main Timeline:
Code:
import britland.Character;
import game.terminal;
var GameTerm=new Terminal();[code]....
I've tried both "flash.display.DisplayObject.stage" and "this.parent.parent" here after discovered that "_root" has been removed and "root" doesn't work in the same way.
View 6 Replies
Oct 28, 2009
I have been struggling with what seems to be simple concept in ActionScript 3.0 - how to communicate between classes. I have a very simple experiment with two movieclips on the stage. They are named YellowBox and RedBox in my library. I have linked the following code to the YellowBox movieclip:
package{ import flash.display.MovieClip; import flash.events.MouseEvent; public class YellowBox extends MovieClip { public function YellowBox() { this.addEventListener(MouseEvent.ROLL_OVER, rollOverHandler); } public function rollOverHandler(event:MouseEvent):void { this.x = x + 3; } }}
What I would like to do is call the YellowBox() function on my RedBox MovieClip with the following code:
package{ import flash.display.MovieClip; import flash.events.MouseEvent; public class RedBox extends MovieClip { public function RedBox() { YellowBox(); } }}
I get the following message when I compile: 1136: Incorrect number of arguments. Expected 1.
View 2 Replies
Sep 10, 2009
How do I let a custom classes know, what I've done at other classes,so that it would run an action accordingly?a function in the button classes:
ActionScript Code:
public function btnClick(event:MouseEvent):void {
var zoomF:theZoom = new theZoom();
[code].....
View 2 Replies
Dec 23, 2009
Basically, I have a menu system for a website that is built on a three tier hierarchy. onclick event handlers load movieclips which contain the next submenu in my menu system. Each menu and sub menu is a series of movieclips with roll over, roll out and click eventlisteners applied to them to give them button characteristics.
However, I have hit an unforseen problem. I need to be able to control all the onclick event handlers assigned to all my buttons from one place, not in lots of different movieClips. I want to be able to add and remove different website content pages in one display object or else I fear that pages will start to appear to overlap as they are added within their specific sub menu movieclips.
I guess what I am trying to say is, can I control movieClip instances that are contained within a child object from my main timeline?
View 1 Replies
May 30, 2010
I'm just starting to build my first proper OOP piece.I have on stage two manually placed MCs.One is viewer_mc:ViewerClass and one is menu_mc:MenuClass.They each have their own class and there is a document class...
PHP Code:
package
{
import flash.display.*;[code]....
So I can call the public method of either class from the other class.However, I am now trying to understand custom events and dispatching them with parameters.which uses a custom event class.This works fine when the dispatchevent and listener are both in the viewer class, but when the dispatchevent is in the viewer class, and the listener is in the menu class I can't get it to work.I suppose for my purposes I don't really need to use the custom event class, I can just call the respective classes' public functions but I just wanted to try and understand how it works.Here's the pared down version of menu class...
PHP Code:
package classes {
import flash.display.*;
//some other imports[code].........
View 4 Replies
Feb 25, 2009
I am having problem making classes to communicate. I have main class which loads external swf that contains one image at this time. I want to change alpha for that image using button (created from library) from main swf. Don't know how, various methods I tried gave various error messages.
View 5 Replies
Oct 12, 2009
I have this error when I run the files.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.common::stageConfig()
at cloudsMain()
CloudsMain.as which is attached to the .fla
[code]....
Basically I'm trying to create a class that I can call and centralise any mc on stage by eg.stageConfig.centralisedDO(my_mc), However I encounter the above error.
View 2 Replies
Sep 2, 2011
so im bringing in a test external swf like so:
[Code]...
this simple external test swf has 10 frames. @ frame 1 theres a "intro" label, @ frame 5 theres a "stop" action, and on frame 6, theres an "outro" label. problem is that, when i click the button, it reloads the external swf and plays from frame 1.
View 3 Replies
Jun 16, 2010
When I compile and publish my flash movie and put it in my xampp/htdocs folder and then run the movie from Firefox, it works just fine. However, every time I try and run it in the Flash IDE, the PHP script doesn't get compiled. Instead, the uncompiled code gets read in as the data, and so when I run trace(evt.target.data), it basically shows all the PHP code plus a bunch of other gobeldygook. If I remove out the line loader.dataFormat=URLLoaderDataFormat.VARIABLES;, it then just shows the PHP code as is.
My question is this: what do I have to do to make the IDE run the compiled PHP script instead of just loading in the raw code as is?
[Code]......
View 7 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
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
Apr 16, 2009
i keep getting this error..and nothing works..here is my php code and i have attached the fla file [code]
View 2 Replies
Nov 11, 2009
We're designing an application and the client has requested that a portion of their app stay in Java Web Start and another portion be in a browser. I'm thinking about AIR as an alternative to the browser because that may give us more features b/c we don't have to stay in the browser security sandbox.How would I go about having an Air app talk to a Java Web Start app? Do they have to talk through a server? I guess potentially you can just create a socket connection between the two.
View 1 Replies
May 26, 2009
I'm working with cart software called PinnacleCart. It's a pretty good system, I use it mainly because of the flexibility in the attributes fields, and our products require alot of customization. The obvious solution here is to add in a Flash customizer, to make it easier for prospective clients to see the changes being made to the items. Inside of the cart software I can select images to upload. I thought about stripping out the validation so I can upload .swf files (edit the product page php to embed if it's a swf file) and go from there.
Now here is the tough part, for usability reasons I want to remove all the actual attribute options - So the logic is simple, if SWF = true then don't display attributes. So, from here I assume when the person clicks 'add to cart' I need to run some javascript to grab the attributes from flash, assign them to the javascript attributes, then proceed as normal.
[Code]...
View 1 Replies
Oct 14, 2009
I'm setting up an HTML page that automatically starts playing a flash video. Well at the bottom of that page - is an area with testimonials thumbnails that the user can click on loading up a small flash video in that component. Is there a way to tell the main video to pause or restart or whatever so that I don't have two videos playing at once
View 7 Replies
Oct 14, 2009
I'm setting up an HTML page that automatically starts playing a flash video. Well at the bottom of that page - is an area with testimonials thumbnails that the user can click on loading up a small flash video in that component. Is there a way to tell the main video to pause or restart or whatever so that I don't have two videos playing at once?
View 1 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
Jan 26, 2010
I have a Master.swf which loads in a game, lets call it A.swf. Once the game is finished, Master.swf then loads the home page, lets call it B.swf. I have this working.
I have a progress chart in my home page which tracks the user's progress in the game (like number of successful attempts, number of items collected etc etc). If a user completes the game, and the home page is loaded, then how do I get the newly updated info to display in the home page?
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
Apr 19, 2009
i have seen this done where a flash file knows what page it's on by some piece of code on the html page. It could have been php or java i don't know but i would like to know how to do that. That way i create one flash nav bar and it can tell what page it's on so i can make it so you can't click the page your on.Let say i have three pages Home, About us and Contact us and build a flash navigation for it. Some where in the HTML documents there is a code that tells flash what page it is. Flash reads this info and knows "oh i am on the Home page" or "i'm on the Contact us page" and will respond accordingly.
View 2 Replies
May 13, 2009
Im working on a project wherein I have the main fla tied to a document class entitled MyContent. The main fla consists of buttons and textfields, etc. External swfs are loaded when the buttons are pressed. My question is what code would I have to include in one of the external swfs to allow it to be able to change the content of one of the textfields, which was assigned dynamically in the MyContent class? The code within the MyContent class consists of a dynamic text field on the stage named longDesc and a string named long1. ex:
Code: longDesc.htmlText=long1; In the external swfs I have images that are enlarged on a click event and would like to be able to have the textfield in the MyContent classed changed as each image is selected through code in the external swf.
View 4 Replies
Jul 10, 2009
Okay so i heard it was possible but im not sure.
Example: i have 1 main swf containing everything. inside that swf i load 1.swf
can 1.swf share the same vars and everything as the main swf? such as.. if i click a button in 1.swf, then something will happen in my main movie.
View 3 Replies
Mar 12, 2009
I use loadVars to communicate with a .php file. When theflash files is on the same domain url, let'sthe .php file the communication between flash and php works. When Iput the flash file on another domain than the .php file (somethingcommunication process doesn't work anymore
View 3 Replies
Jun 9, 2009
I have finally figured out how to preload, and gotten my main movie to load an external swf properly. My last hang up, is how to speak to that loaded swf, with a button added above it in the main timeline.So, my button is Nextbtn (added via addChild), and my swf is titled "about_mov.swf", when it is loaded, it goes to frame 10 and stops, what I want to happen, is when you click the NextBtn, that loaded swf advances to frame 11. Just not sure how to reference it properly, and hping i can get a quick solution on it.
View 5 Replies
Jul 19, 2009
I have a flash container that loads other flash files that have been made in Adobe Captivate, (essentially just normal SWF files) and on top of that I have other SWF widget files that I have created as it's children to extend default Captivate functionality. So essentially i have 3 'levels' of loaded SWF's.Container -> Captivate SWF -> WidgetThe problem lies in the middle - I don't know how Captivate is arranging its variables, events and loaded children since I don't have access to it's code. What I want to do, is to get my container SWF communicating with the Widget one and vice versa, but I can't get the hiearchy working... I can send values to the "stage" via the widget, but not vice versa.
So firstly, since I don't have the SWF code -- Is there a way to list all variables inside a child or parent so I can work this out?- Is there a way I can tell when a child or parent is triggering an event? (especially when I don't know the names/functions of the event)- and is there any easier way I could be going about this that i'm not seeing?
View 5 Replies
Nov 15, 2010
I have loaded an AS2 swf inside another AS2 swf using MovieClipLoader. I have no control(cannot edit) over the child swf. Is there a way I can communicate with the child swf from the parent swf. The child swf is not accepting any LocalConnection Objects. Can I call a method in the child swf some other way?
View 2 Replies
Jul 26, 2009
I can successfully call ajax-like functions from my Flash header to update my page. But how can I update the SWF with calls from my page. My page is XHTML. When a link is clicked, I would like the Flash header to move to a specific keyframe.
View 0 Replies
Nov 30, 2009
I seem to be having issues with sendAndLoad() from different scenes.When I load the .swf (ctrl+enter) the communication is fine, when I naviget to scene2, the same code doesn't seem to execute at all...
Code:
//--------HERE WE SEND THE DATA--------//
var myLv:LoadVars = new LoadVars();
[code].....
View 1 Replies