Flash :: Call Variable Inside A Function ?
Sep 25, 2011
I'm trying to pass a variable through a function, but I'm getting it's value 0. Here's my code:
thumbLoader.addEventListener(MouseEvent.CLICK, goToCategory);
function goToCategory(e:MouseEvent) {
trace(c);[code]....
this trace gives me value of 0. Normally I would do goToCategory(c) and inside that category I would get it's value, but in this case I'm calling this function with an event, how can that be done?
var c is declared globally, so I'm using it above this code in different place... is there smth like global $c like in PHP.. or there's some other way to do it?!
View 2 Replies
Similar Posts:
Feb 3, 2009
Does anyone know if there is a way to call a dispatchEvent call from inside of a static function?
View 2 Replies
Mar 2, 2010
From a button in Flash I just want to call a function written in jQuery.When I place the function outside jQuery's $(document).ready it works fine:[code]
View 1 Replies
Oct 4, 2010
Let's Say I Have This Class:
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
trace(getAverage(1,2,3));
trace(getAverage(1,2,3,4));
[Code]...
View 5 Replies
Nov 16, 2010
I'm having some trouble finishing an interface i'm working on,the function indica() adds a menu listing of items (indicadores) inside a mask because its too large, and i added a scrollbar that allows to scroll through the items but now i need to add the buttons inside the movie clip indicative,i can add symbols and buttons, but i'm having trouble having them call functions inside the same class that the function indica() is running.[code]
View 2 Replies
Feb 12, 2011
var speed:int = 4;
addEventListener(Event.ENTER_FRAME,MoveRight);
function MoveRight(event:Event):void{
[code]......
View 3 Replies
Nov 24, 2010
I want to monitor a variable. Whenever the variable value changes I want to call a function. In actionscript 2 I can use "watch" but in as3 what can do ?
View 1 Replies
Jun 18, 2009
let's say I have 3 functions like this.
ActionScript Code:
function function1(e:event):void{
//code
[Code]....
Can I somehow, stop the enter frame in function 2 with some code in function3? I know that is not the better practice, but in this case is really needful to have a function inside another.
View 6 Replies
Mar 18, 2007
how could i call a mc, from inside a function, being this target stored in a var
ex:
var clipVar:MovieClip = this.main_mc.myClip_mc;
function goX (){
this[clipVar]._x = 100;
}
goX();
no parameters for the function?
View 2 Replies
Aug 31, 2008
This is hard to explain, but basically here goes: have a "frame" movieclip that loads images. I call frame.loadImage(the URL) and everything works. So far so good.When I put "frame" inside of another clip, named "frameHolder", then call frameHolder.frame.loadImage, nothing happens.
View 9 Replies
Feb 18, 2010
I have taken variable in one function and want to use that value in another function.
View 2 Replies
Sep 16, 2009
I need to pass a variable to a function inside a function. However this parameter (i) seems not to be passed (to function ...onRollOver). This is required to attach a textfield to a movieclip (reading the adress and showing it as a tooltip).
ActionScript Code:
for (i=0; i<array_BE_ElecCities.length; i++) {
var attachElecCity = mc_map.mc_places.attachMovie("Plant",
[code].....
View 1 Replies
May 5, 2011
I want to create a vector, then call a function that populates that vector with arrays. Fine. The only catch is the function itself will declare new array variables to put into the vector, but are these new array variables private to the function only?e.g. something like this
ActionScript Code:
public var vec:Vector.<Array> = new Vector.<Array>();
private function populateVec():void {
[code]....
Is this "kosher"? a was declared in the private function but added to something outside the function..?
View 4 Replies
Sep 13, 2010
when we write
var obj1=new Object();
var obj2=obj1;
we know obj2 is just a call of obj1, they are the same thing.also, prameters of function are also the calls of the object outside e.g.
var objC=new Object();objC.name = "Jhon";[code].........
it seems that when setting tar to null, the obj outside in the function didn't changeit seem taht everything you do will pass to the real object, but not setting it to null;
my questions: how to make the real object became null with a call?
View 2 Replies
Oct 25, 2005
I've got some problems trying to call a function inside a mc in a class.For example:
Code:
class Foo {
private my_mc:MovieClip;
[code]......
View 3 Replies
Mar 19, 2005
how do you call a function that is inside another movieclip?Do global functions have to be declared on the root? I'm trying to do a very simple thing, take the grid tutorial and apply it as a mask to an image. Everything works ok, now I would like to call the function that makes the grid after the pic has loaded.
So I have on the root:
mc_picholder
mc_boxholder <---This mc contains the function that makes little boxes
I can assign the mc_boxholder as a mask to the mc_picholder and this works fine. Now say I have a function in mc_boxholder called makeboxes(), and I want to call it from the root once a pic has finished loading into mc_picholder.All the functions to make the boxes are inside the mc_boxholder. I've tried declaring makeboxes as global, and calling it from the root, doesn't work.I've tried tried writing from root: mx_boxholder.makeboxes(), doesn't work either.....
View 3 Replies
Oct 28, 2009
I have a mailTo: function that needs to be added to a button that sits inside of a movieclip. I put the code inside the actionscript layer in the movieclip.[code]...
View 2 Replies
Jul 14, 2010
1- i have class and i called its before and its running on runtime. i need to call function inside this class from another class, but without call the first one again, because if i called it, it will run default class function again is this doable ?
2- What super() mean ?
View 4 Replies
Aug 1, 2011
i want to call an external function inside a class. thats the code;
in checkConnectionStatus function,
this[_funcNameForSucceededCon].apply(); doesnt work because "this" is the class, not the Application. How can i reach Application at this time or what can i do?
package myLibrary
{
import air.net.URLMonitor;
import flash.events.Event;
[Code]....
View 1 Replies
Jun 29, 2011
i want to call a function from within a function using a variable representing its name...
[Code]...
i've been tryin to figure this out for quite some time now since FLASH MX , i just kept abandoning a solution.. and now i'm once again in need of this , still cant solve it so im postin...
View 2 Replies
Jun 24, 2006
I'm just getting the hang of AS2 OOP, after avoiding it for all this time, and I have set up my first couple of classes.
One class generates an array, and the other class takes this array, and uses it it to place MC's on the screen, and gives each mc an onEnterFrame function. I have a stack of these onEnterFrame functions, named 'avoidIt1()-avoidIt11()'[code]...
View 2 Replies
Feb 7, 2009
I have an object and would like to call a function from it, which the way I am trying to do it, does not seem to work. Here is what I have:
Code:
private function setTimer():Void
{
[code]......
View 0 Replies
Jul 1, 2004
I have a function at frame 1 (_root). Well, i am trying to call this function from a button, inside a movie clip, but it's not successful..
View 2 Replies
Dec 23, 2008
I need a way to call a function from a function. It's not that hard, I know, but the name of the nested function is a variable passed into the first function. Like in setTimer() and other functions in flash, where you have the name of a variable to call. I'm going to have a lot, so doing some cheap if(funcname == blabla){blabla();} won't work.
View 1 Replies
Mar 15, 2010
how can i call function inside movieclip in library panel it is not on time line
View 2 Replies
Oct 4, 2010
I'm having a bit of a hard time with calling a function in the main timeline through a button in a movieclip. The mc is in the main timeline and in it I added a button with this.removeMovieClip(); and so far it works, but when I try to call a function from the main timeline it just doesn't seem to work.
View 13 Replies
Aug 15, 2011
I know there are ways to invoke javascript inside the html wrapper template for the flex application using ExternalInterface, but is it possible to reference an external html page?
View 3 Replies
Apr 2, 2009
I just need to call a variable or function from a movie clip to main timeline. In AS2 I would use something like:
_root.myvar = "Hola";
or
_parent.myfunc(4,2);
But this doesn't works on AC3. I tried to remove the "_" but its the same.
View 2 Replies
Mar 15, 2012
I need to call an object or function name with string variable.[code]it's working but, if I do something like below its not working [code]
View 2 Replies
Sep 1, 2011
I have a main application that contains a list, using a custom itemRenderer to display data.
I would like to be able to call a function, inside the itemRenderer, from the main application.
When running the app, we have a list with three persons, and a button. I want to call the function myItemRendererFunction() inside the itemRenderer, of the selected item in the list, all this, from the main app.
[Code]...
View 1 Replies