Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-05-2005, 07:41 AM
Junior Member
 
Join Date: Apr 2005
Posts: 8
Default Array into form, is it possible?

I use this code to open a form
Code:
bp = new Form;
bp.movie = getMovies()[1];
bp.showCaption = true;
bp.canDrag = true;
bp.caption = "Array Window";
bp.show(false)
is there any way of using putArray to pass an array to the form
or is there another way of opening the extra swf as a window, without building it as a separate executable?
__________________
Awaiting Swf Kit V3
Reply With Quote
  #2 (permalink)  
Old 12-05-2005, 12:05 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Array into form, is it possible?

There is no putArray method for forms. But it's very easy to make one:

Code:
function myPutArray(form, fsArray, asArrayName)
{
    for (var i = 0; i < fsArray.length; i++)
    {
        form.setVariable(asArrayName + "." + i, fsArray[i]);
    }
}
Reply With Quote
  #3 (permalink)  
Old 12-05-2005, 04:07 PM
Junior Member
 
Join Date: Apr 2005
Posts: 8
Default Re:Array into form, is it possible?

ok, I understand how that part works
however:
in AS
Code:
var simpleVar:Array = Array();
fscommand("FFish_Run", "MakeArray");
function updateArray() {
fscommand("FFish_Trace", simpleVar.length);
for (i=0; i<simpleVar.length; i++) {
fscommand("FFish_Trace", "Array: "+simpleVar[i]);
}
}
in FS
Code:
simpleArray = []
for (var i=1;i<15;i++){
simpleArray.push(i);
}
function myPutArray(form, fsArray, asArrayName)
{
    for (var i = 0; i < fsArray.length; i++)
    {
        form.setVariable(asArrayName + "." + i, fsArray[i]);
    }
}
myPutArray(bp ,simpleArray, "simpleVar");
bp.setVariable("test_trigger.fArg","")
results in an array size of 0 in AS

"test_trigger.fArg" launches the AS function "updateArray"
__________________
Awaiting Swf Kit V3
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:05 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.