ActionScript 3.0 :: Flash Accessing PUBLIC FUNCTION From Different?
Jan 5, 2011i've put some public functions in one as-file. how an i call the functions in the .fla-code?
just calling the name "go();" doesn't make it:
i've put some public functions in one as-file. how an i call the functions in the .fla-code?
just calling the name "go();" doesn't make it:
I have (may be a simple solution needed) a problem with a class I've wrote. I've wrote a class named Navigation [URL] and in there I make all the buttons for the navigation. Next to that I have a Ipage class [URL] and in there I have all the pages stored. When I click on a button, the Navigation Class is called and tries to access the public function ChangePage in the Ipage class. In the ChangePage function I trace if the function is called and the trace comes back. So it works... BUT if I want to access another object it's not working. I can't even set sprites on visible = false.
View 7 RepliesI've got two classes running...one is a document class (EgoGame.as) and another is a class linked to several similar movie clips (Ball.as).I'm trying to access a public variable from Ball.as which has been declared in the doucment class EgoGame.as.When I run the test the outputs states the following...1120: Access of undefined property _ballPlaced.Here's my code. What I'm trying to do is remove the event listeners from the Ball.as when the _ballPlaced variable is true, so that the user can't drag and drop the balls after they've been placed in a zone.
Document ClassEgoGame.as
package
{
[code].....
i've got two classes and i'm not extending to MovieClip. I like to attach the mc in the constructor just because i'll be working with different MC's that have the same purpose.
however, im using private var loadedMC:Movieclip and now i've got another class that needs to be able to access the instance's variable.
for example, myClass.loadedMC , but this would mean having to make it public and I rather not go that route.
I need to be able to call a method from a component located under the main application in Flex 4. Can anyone tell me please how to do this without using FlexGlobals please?[code]
View 3 RepliesHow can I run a public function in the DocumentClass?
View 4 Repliesthere is an interesting problem here:
How to return a value from a function to public?
Here is the code:
var df:String; //i declared it here
function onResult(e :OperationEvent):void
{
df = e.data.toString(); // i set it here
[Code]...
Is it possible to have a class with a public function [code]...
View 8 Repliescan i call a class public function from another class? what's the cleaniest solution to do that?
[Code].....
a button wich is istanced in Menu, run showTheThumbs method, in Thumbs.
If I override a public function in a base class, I would have thought that this override function is called and the original is ignored? though this doesn't seem to be the case...
public class AbstractScreen extends Sprite
{
public function AbstractScreen()
{
[Code]....
If my model dispatches a CHANGED_LANGUAGE event, the text in the views gets updated, But I also get a trace of "WARNING: need to override public function updateLanguage()"
I have been working on a Flex Mobile application using Flash Builder 4.6. I have 2 mxml 'views' in my project. In one mxml file, i have a function that grabs xml data. In my other mxml file, I have a refresh button that when depressed is suppsosed to call the function in the first mxml file in order to once again grab the xml data. I dont know how to call that function from outside the mxml file it is housed in. [UPDATE #2]* I thought I should share some more details about my issue.
It is a reddit client mobile app. It fetches the feeds, etc. In my main view called RedditReaderHomeView.mxml, I am using a splitViewNavigator spark component to house two other views like so:
[Code]...
If i want to load 2 xml file into one public function, do i need to have seperate private functions for both. do in need to declare 2 variables.
View 9 RepliesIs it possible to override a protected function to a public.
View 5 RepliesIs it possible to call/envoke a public static function from JS? I can't seem to get it working and Im almost certain it cannot but I thought I would ask the community.
View 2 RepliesI'm using exanimo's statemanager class but I dont know how to use this function:
public static function set defaultStateID(defaultStateID:String):Void
how do I call this function?
I have two classes that I am trying to get to intereact, main.as which is the class attached to the stage and then light_mc.as which is attached to a movieclip.
I have a function in main that I would like to access in light_mc. I have set it up so main stores "this" in a variable called instance so I can easily access the functions within main.
Here is the code the main.as
Code:
package
{
import flash.utils.Timer;
[Code].....
I have a datagrid with itemRenderer in datagridcolumn as my custom component(c1). I am getting the dataprovider data in custom component by overriding the set data function, it is fine. But now my custom component(c1) is also having another custom component(c2).
Now the doubt is - how to get the dataprovider data in c2 component?
i want to know what i should put befor .mx_internal
override public function initialize() : void
{
var target:DialogButtons;
var watcherSetupUtilClass:Object;
[Code]....
Is it possible to externally override a public function of a class (as opposed to override via inheritance)?
For example:
Code:
Class Foo {public function doFoo():void {trace ("Foo");
}
}
Such that:
[Code]...
I know this is possible in JavaScript and ECMAScript, but the compiler won't let me get away with this kind of mischief in ActionScript, from what I've seen: It barfs up a 1168 Illegal Assignment error as soon as I attempt to assign a new function to doFoo.
I'm thinking specifically in terms of a "hot fix" solution where you deploy a small swf that replaces a specific chunk of code in a larger application, without the need to recompile/deploy the full application (or even see the sourcecode for that matter, just know the API).
The title says it all. Is there a way I can execute a public function (defined in a .as file,linked to .fla) when typing some script in a frame?i get this error:1120: Access of undefined property btn_upgrade1120: Access of undefined property comp_verapparently, flash does not let me use my public functions in my .fla .
View 6 RepliesI'm a bit confused in AS3, after long developing in 1 & 2. I'm doing a radioplayer, so I did set my document to be of document class: RadioPlayer. Here is everything ok, sound playing etc. Now my client wants to add a volume button. So I made a movieclip of class VolumeManager. Now, to change the volume, I want my clip to call a public function of RadioPlayer.
As RadioPlayer is the document class I don't know how to reference it inside VolumeManager to call its public function. In AS2, I would say: _root.setSoundVolume(volume);
What would be the scoping to reach a variable within a external class public function FROM a function on the main timeline?In menu.as public function buttonClick()Need to reach a starFunction variable(var starFunction = such and such.@fn) within an if statement within buttonClick function.On main timeline(menu.as declared on first frame main timeline as var menuH:Menu = new Menu()In function aboutUs()here is where I need to use that variable for an if statement
View 1 RepliesI am trying to create a public function, i have a decument class with all of my variables in it, I have worked out how to bring in external .swf files, now I need a way to have an even trigger something on a separate .swf So at the moment I have a flunction that works on the parent
stage.addEventListener(MouseEvent.MOUSE_MOVE, mousePosition);
function mousePosition(event:MouseEvent) {
if(mouseX>=125)
[Code]....
How do I call a custom component's public function from the main app. For example, I've got a timer component, MyTimer.In the main app, I want to call startTimer() or stopTimer().In the main app, I've got:
<visualcomponent:MyTimer />
In the component, I've got:
public function startTimer():void {
[code].....
I'm having some big issues with the scoping problems in my XMLConnect Class. I already found some things about the Delegate class online for setting the scope correctly, but my code still doesn't work the way it should Problem I need the XML data to be accesible in the public function Strip() because the user needs to put in some characters to strip from the strings in the xml file. Does someone known how to fix this scoping problems?
[Code]...
How can I return an object with an update data, that is pass in to a public static function?
GetDate.dayName(MyDate.setDate(1984,3))
//MyDate with new info (year, month) will be pass into GetDate.dayName
package hwang.time
[code].....
I am trying to add multiple different versions of the same button to the stage and to be able to access them later on by assigning them an ID. The way I assumed this would be done is to have a class for the button where an internal static variable is defined so that the ID can be found in the next function. This does not seem to be working, as the ID is constantly showing as the last number given, so in this case 6.I assume that I am doing this wrong? Here is my code so you can better understand:
package src {
import flash.display.MovieClip;
import flash.events.*;
[code]......
If I have a main.fla and main.as (where I written a Main class).
How can I access a public function (main.as) from main.fla?
is it better to use public variables or public static variables?
View 6 Replieswhy can i access the first function in a class with
PHP Code:
import test.test
var test:test = new test();
but I cannot access the second or third function in the same manner? they seem to be seperte entities within the class definition.
can access
PHP Code:
public class NetStreamex {
public var connection:NetConnections = new NetConnections();
public function NetStreamex():void {
connection.createNetConnection("rtmp://localhost/test/1");
[Code].....