ActionScript 3.0 :: Pass Movieclip To Function?

Oct 27, 2010

I'm trying to make some tables. I have some movie clips:

cella1
cella2
cella3

[code]....

View 5 Replies


Similar Posts:


Flash :: Use MovieClip Target Name To Pass Variable To Function

Feb 22, 2012

How can I combine the following functions and still pass a different string to the buildUI(); function?

I have two functions that do the same thing only at the end they both call a function and pass a String value to the function. This string value is the only thing different.

Below is are my eventlisteners and functions as they are now:

female_start.addEventListener(MouseEvent.MOUSE_DOWN, startFemale);
male_start.addEventListener(MouseEvent.MOUSE_DOWN, startMale);
//FUNCTIONS THAT DO THE SAME THING AND BOTH CALL buildUI BUT PASS A DIFFERENT STRING.

[Code].....

View 1 Replies

ActionScript 2.0 :: Make A Dynamic Function ,pass A String Var For The Name Of Any Nested MovieClip?

Mar 2, 2007

why wont this work?

some_mc["nested_mc_name"].onPress = function():Void {
trace ("test")
};

I'm trying to make a dynamic function so I can pass a string var for the name of any nested movieClip I want on the fly.

View 1 Replies

ActionScript 2.0 :: Callback - Can't Pass Data In That Function - Laco Tween Movieclip MC

May 20, 2005

it seems to me that when you use laco tweens and callback a function, you can't pass data in that function, because the function won't wait until the tween is finished but is being carried out right away. For instance, I want to tween movieclip MC:

[Code]...

View 1 Replies

ActionScript 3.0 :: Call Function, Pass Value, Access Variable In Movieclip Class From Main Stage?

Nov 20, 2008

I have a movieClip named MC, and it's enabled with action script, with the class name MC_Rectangle and a Stage.I override the MC_Rectangle class file in a mc_rectangle.as external file.here is the code:

package{
import flash.display.*;
import flash.events.*;[ code].....

I have new a object in the main stage var

mc_rect:MC_Rectangle = new MC_Rectangle()

in main stage:

1. how can i access the variable "sequence" in "mc_rect"

2. how can i pass parametre from main stage to mc_rect via function setSequence(data:int)?

3. how can i call the function in addSequence() in mc_rect.

in asp.net, i usually use mc_rect.sequenct,mc_rect.setSequence(data), mc_rect.addSequence() to achieve my goals......btw, can function in mc_rect return out result to main stage?

View 1 Replies

ActionScript 1/2 :: Pass Parameters Along With A Function That Is A Parameter To Another Function?

Sep 3, 2010

I'm having some trouble passing parameters with a function that is itself being passed as a parameter.In my application code I'm instancing that class five times:they are buttons in a menu.In that class, I've got an onRelease handler that does a number of things when a button is released, one of which is to invoke a function that is defined in the application level of the code.My problem is that I don't know how to send the function parameters.In my StandardButton class I have:

class StandardButton extends MovieClip
{
/* define properties */[code]..........

The function is successfully being "sent" to the StandardButton class, but without any parameters.How can I send parameters to the class instance with the way I've got this architected.

View 7 Replies

ActionScript 1/2 :: Pass Function In XML?

Apr 14, 2011

My question is can you write a function in an XML document and then load that XML document into Flash and call that said function?

View 5 Replies

ActionScript 3.0 :: Pass A Var From A Function To Another?

Oct 21, 2009

i'm new of AS3.i've a function in which i create some var like:var str_Foto_tn:String="";then i make a parse of a xml and i put a node value into my var.then i've another function that make a MC and addChild that MC on stage.. the name of that MC is my str_Foto_tn.But he can't see the var... how i can do?

View 6 Replies

ActionScript 2.0 :: How To Pass In Value To Function

Apr 7, 2010

how to pass in value to the function.I am using CS4 and AS2.This is my code:

attachMovie("platform","platform0",1);
platform0._x = 300;
platform0._y = 600;
platform0.onEnterFrame = a(0);

[code]...

I try to pass in this but it fail.

View 5 Replies

CS3 : Pass A Variable Calculated In A Function

May 8, 2009

how I can pass a variable calculated in a function, to the stage.

View 9 Replies

ActionScript 3.0 :: Pass Variables In A Function From Swf To Swf?

Sep 26, 2008

How do i pass variables in a function from swf to another swf?

View 4 Replies

IDE :: Pass A String To A Function And Use Its Value As The Variable Name?

Dec 21, 2009

Is there any way that you can pass a string to a function and use its value as the variable name you wish to change. For example.

Code:
var text:String = "Goodbye World";
function myfunction ( varToChange)
{
varToChange = "Hello World";
}
myfunction("text")

View 2 Replies

ActionScript 3.0 :: Pass The E:MouseEvent To Another Function?

Aug 16, 2010

How do i pass the e:MouseEvent to another function??

[Code]...

View 3 Replies

ActionScript 1/2 :: Pass Values From One Function To Another?

Apr 25, 2011

I am a middle school teacher and a newbie in Flash Actionscript. I am trying to create a countdown timer for use in my class during tests. The start and pause functions work as required, but not the pause button. When I click on the pause button, the timer is reset to 0:00:00.[code]

View 1 Replies

Flex :: Pass A Set Function As An Argument?

Nov 11, 2009

How can I pass a 'set' function as the Function Object argument of another function?eg:

public class IdModel
{
private var _id:String;

[code].....

View 1 Replies

ActionScript 3.0 :: Pass The Name Of Array To Another Function?

May 3, 2010

I have a function call as shown here: ActionScript Code:c.draw(colorRead.population); In this function, I would like it to be able to print out population as part of the string for my toolTip. Note, what is in the parameter here may not be the case in every of the instance I need to create.

[Code]...

View 1 Replies

ActionScript 3.0 :: MouseEvent To Pass A Value To Function

May 22, 2010

I'm sure this must have been covered 100's of times but I have searched and searched with no joy so... I'm trying to simply pass a value into a function using a MouseEvent, CLICK (the example below is just that an example not what I'm actually trying to do)[code]...

View 4 Replies

ActionScript 3.0 :: Pass Value From A Loop To A Function?

Jul 20, 2010

this is a standalone AIR app which runs off of usb media to help people organize their personal information. there is an XML file in a separate folder which stores the name of a file that the user uploads to usb media (into yet another folder), in this case, the person's living will. getting the path to that file as it differs from mac to pc has been a challenge and i feel the only way around this is to give a conditional for the operating system (second function below).

My immediate goal below is to get the name of the file (VALUE) over to the openThisFile function so that "fileName" can be given a value appropriately in the second function code for mac. I can't figure out how to do this...Alternately, is there a way to manipulate "currentTarget.data.toString()"? I was thinking that could also help me... it has the full path to the file, which unfortunately does not work on Macs... for some reason it just can't locate the file (unless I'm missing something).

Quote:

public function handleLoadData(event:Event):void {
try {
propertyFilePath = path;

[code]....

View 0 Replies

ActionScript 3.0 :: Pass A String As Function?

Oct 7, 2010

How to display the correct digits. For instance, if the answer is 97%, I want the display to show 97, not 11. Please feel free to view the SWF or look at the FLA file to see[code]...

View 5 Replies

ActionScript 3.0 :: Pass Function Parameter 'evt'?

Feb 24, 2012

I'm just looking for clarification on the passing of a parameter and why/how it works.

In this example, it looks like you create a parameter to be passed in called 'evt', but I don't see it used anywhere in the function. [code]...

View 9 Replies

ActionScript 2.0 :: Pass Arguments To Function?

Jan 21, 2003

I'm having a little problem with how to use the argument sent to a function.I have this:

Code:
_root.onEnterFrame = function() {
setPanning(1);

[code].....

View 3 Replies

ActionScript 2.0 :: Pass A Variable From One Swf To A Function On Another Swf?

Nov 8, 2005

I was just wondering if it's possible to pass a variable from one swf to a function on another swf?

I have 2 containers on my main stage, each one loads an external swf, I want one to send a variable to a function in the other container.

I simply tried calling the function by doing _root.container2.fncTest("works"); just to see if it works

and in container2 I have

Code:
function fncTest(test):Void {
myText = test; //dynamic text box on the stage
}

but that didn't seem to work.. Do I have to make the function public or that only works for classes?

View 13 Replies

ActionScript 2.0 :: Pass X Arrays To A Function?

Nov 12, 2007

I'm trying to pass an array of X arrays as parameters to a function such as :

var someArray = [0, 1, 2];
var someOtherArray = [A,B,C];
array = [someArray, someOtherArray,...];
myMC.someFunction(array);

The problem is that the function doesn't see where the 1st array stops, it's like passing a big array such as

myMC.someFunction(someArray,SomeOtherArray, ...) becomes
myMC.someFunction(0,1,2,A,B,C) instead of myMC.someFunction([0,1,2],[A,B,C]);

I even tried to make a string such as str += "[array[0]]"+","+"[array[1]] ..but it still passes everything as one big array....how to pass X arrays to a function??

View 2 Replies

AS :: IDE - Pass A String To A Function And Use Its Value As The Variable Name

Mar 18, 2009

Is there any way that you can pass a string to a function and use its value as the variable name you wish to change. For example.

[Code]...

View 1 Replies

ActionScript 3.0 :: How To Pass Parameters To Function

May 12, 2009

I have a hard time getting this
Code:
var whichXML:String = "category1";
loadFirstTime(whichXML);
function loadFirstTime(whichXML:String):void {
XMLLoader = new URLLoader();
XMLLoader.load(new URLRequest(whichXML + ".xml"));
}

View 1 Replies

ActionScript 3.0 :: Pass Method To Function?

Mar 15, 2011

This is what i want to be able to do, only i can't... And i don't want to have a loop when i call the method executing the methods in my children. Hints?

Code:
this.executeMethod([Function(methodInChild)], ArrayOfChildren);
private function executeMethod(_methods:Array, _instances:Array):void{

[Code].....

View 1 Replies

ActionScript 3.0 :: Pass A External Variable To A Function?

Aug 6, 2010

I have an external log file which name changes each session, with the format XXXXX.log

I need to load it inside a swf to show its data, but each time the logs name is different, I need to open the .fla, changing the name of the file and then republishing the swf.

So I have made a simple script to load another .txt, to type manually in it the 5 number of the logs name and load it externally inside the swf:

Code:
var logNumLoader:URLLoader = new URLLoader();
logNumLoader.dataFormat=URLLoaderDataFormat.VARIABLES;
logNumLoader.addEventListener(Event.COMPLETE, loadedLogNum);

[Code]....

While I cannot assign the value of logNum to the last function, the .log cannot be opened.

View 2 Replies

ActionScript 3.0 :: Pass A Child From The Constructor To Another Function?

Sep 6, 2010

I'm sure that I'm doing something daft here - I just need to remove a child that's created in the constructor through an event listener.My code is below but does not work. Can someone point me in the right direction please?

public class Main extends Sprite  public function Main()
super();
var rectangleIndex:uint = this.getChildIndex(playerBackground)

[code]......

View 5 Replies

ActionScript 3.0 :: Pass Parameter To EventListener Function?

Dec 1, 2010

how to pass parameter to eventListener function.[code]

View 1 Replies

ActionScript 3.0 :: Pass A Parameter To The Constructor Function

Mar 3, 2011

I´d like to know how could use the Timer class extended.I´m trying to pass a parameter to the constructor function, so I can use it inside the listener.
 
Here´s example:
 
[CODE]
package { import flash.utils.Timer import flash.display.DisplayObject public class ChangeColorTimer extends Timer {    public static const CHANGE_COLOR:String = "changeColor";    public var obj:DisplayObject    public function ChangeColorTimer(delay:Number, repeatCount:int, obj:DisplayObject ) {   super(delay, repeatCount)   this.obj = obj   } } }
[/CODE]
 
That was the ChangeColorTimer that extends Timer.Now, I´d want to know how would I use ChangeColorTimer.I thought it was the same as using Timer.I´ve tried this:
 
[CODE]
public function changeColor(mc:MovieClip):void  {   var colorTransform:ColorTransform = new ColorTransform()   colorTransform.color = 0xEE0000   mc.transform.colorTransform = colorTransform   var changeColorTimer:ChangeColorTimer = new ChangeColorTimer(400, 1, mc)   changeColorTimer.addEventListener(ChangeColorTimer.CHANGE_COLOR, setNormalColorListener)   changeColorTimer.start()     }  private function setNormalColorListener(e:Event):void{   trace("called")        }
[/CODE]
 
I called changeColor, but, I don´t get "called" in the output from the setNormalColorListener listener.

View 2 Replies







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