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


Similar Posts:


Flash :: Pass Arrays From It To PHP?

May 20, 2011

I am having a problem passing an array variable from Flash (AS2) to PHP. In action script I have several arrays defined like this[code]...

View 3 Replies

ActionScript 3.0 :: How To Pass Multidimensional Arrays To PHP

Apr 27, 2010

I do not understand how to pass an array to PHP! I have a number of multidimensional arrays that I would like to pass over.

Example:
array1 -
character[0][0] = "dog";
character[0][1] = "cat";
character[1][0] = "dog";
character[1][1] = "frog";

View 0 Replies

Flash :: Arrays - Properly Pass Array To Class?

Oct 11, 2011

I try pass my Arry to Class. I try to pass it and it look like this: Frame 32 earlier are some animations.

[Code]...

View 4 Replies

ActionScript 3.0 :: Flash Object Arrays: Pass Values For Selecting Only Some Objects?

Sep 2, 2010

What i'm trying to do is creating an array of objects, little squares that are positioned in a grid with coordinates and when i click on the coordinates i need to select only the elements which fit with the value. So, what i'm trying to do now is to pass a value to each element of the array but it doesn't work:

[Code]...

View 2 Replies

Arrays :: Flash - Defined Within A Function Discarded At The End Of The Function?

Jul 6, 2011

Curious question:Take this function:

function something():Array
{
var ar:Array = [];

[code]....

View 2 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 2.0 :: Use Arrays As Function Parameters?

Nov 29, 2010

Something like[code]...

Since I have to loop through all of them. I can convert them to an array inside the function, but it would save me 10 lines if I could just enter them as an array in the function parameter (as I have 10 variables 1-10...)

View 4 Replies

ActionScript 2.0 :: [FMX] Sort() Function For Arrays?

Feb 9, 2004

the sort() function for arrays in Flash MX. How efficient is it? I am currently developing a flash application that will need to read in hundreds of records from a database and sort them.speed is crucial. Which is better? to use the built in sort() function or to create my own shell-sort?

View 3 Replies

Flex :: Arrays - Write Function Object To Bytearray?

Jan 1, 2011

I have byte array, and I want to write into it a Function object, like the following:

var func:Function = function f(event:Event):void
{
trace('hello');
}

[Code]....

View 1 Replies

Arrays :: Flash - Data Being Lost Outside Of Loader Function

Nov 4, 2011

Trying to make a grid based question answer game and load variables from a text file using for loops into an array. I wanted to reduce redundant code and use for loops to populate my arrays. The issue I am having is with my arrays being lost/destroyed outside of the loader function.

I understand that if an array is declared inside the function, naturally the array would be destroyed upon exit of the function. However I am declaring the arrays outside of the function so the arrays should remain intact after I exit the function.

BTW - I'm not having an issue with the loading of the data. The data is loading correctly. The array is simply being destroyed after the data has loaded.

//Create the arrays to hold the
//categories, questions, and answers
var categoryArray:Array = new Array();
var quesAnswArray:Array = new Array();

[Code].....

View 1 Replies

ActionScript 2.0 :: [AS2] Looping Function - Using HitTest(); With Movieclips Within Arrays

Apr 28, 2007

[Code]...

NOTE: The following text is my problem and observations, if you afraid to read it all, my problem is easily guessable within the code go ahead and crack at it without my explanation :-p I'm having some trouble with using hitTest(); with movieclips within arrays. I wanted to build a function that checks the hitTest of Movieclips in arrays because the array is dynamic and it would run more efficient and faster this way.

As you may notice it doesn't check just the movieClip in the array, but a movieclip 2 scopes within it. I feel that this is my problem. I noticed in my debugger that that mc doesn't show up, but i put an onLoad event on it to trace its existence when loaded and it shows up fine. I wonder what I'm doing wrong.

View 2 Replies

ActionScript 2.0 :: Create A Function That Creates An Array Of Arrays?

Mar 28, 2009

I have to create a function that creates an array of arrays. I have to be able to add elements to the array, delete elements and extract elements? the elements will be arrays. How to I do that, or it is possible?

View 8 Replies

ActionScript 3.0 :: Button Click Function In FLVPlayer - Converting To Arrays?

Feb 8, 2010

Basically, I have a FLVplayer called vidPlayer and 3 dynamic text fields that put text in when they are clicked. I want to be able to keep the button clicked in the 'over' state, and to do this I believe arrays are needed? Also, an array might be easier, as there is a lot of code to sift through.

Below is the code for the buttons in my flv;
Select all//video player script
function fenwick(event:MouseEvent):void{
vidPlayer.source = "flvs/adver/Fenwick.flv";
}function moneyshopGold(event:MouseEvent):void{
vidPlayer.source = "flvs/adver/MS_Liquid_Gold.flv";
[Code] .....

View 1 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

Arrays :: Actionscript 3 - Creating A New Array For Eache Iteration Of The Function Call. AS3

Oct 5, 2011

so I have writing a function that returns objects on the stage and puts them into an array. and the function works fine until i call the function on more than one object name, meaning if im in the root class, and I call this function on object1 lets say it will add all the object one's from the stage, but if i call it on object2 it will throw an error, which makes some sense, i guess it means that it is not adding it to a unique array, but im not sure how to do that. would it be a good idea to maybe make a multidimensional array? if that is the case would it be too slow?

[Code]...

View 1 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 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

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







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