Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-13-2005, 10:44 AM
jbs jbs is offline
Junior Member
 
Join Date: Dec 2005
Posts: 4
Default Problems with obj.string...

I'm using SWFkit Pro 2.2 and SWFgen to create a small application where users input text among other things. I keep getting "$EXAMINER1", "$EXAMINER2" etc in the OUTPUT but not the string that I enter in the USER_SIDE and I can't figure out where I am going wrong.

Can anyone see where I'm going wrong? Any help would be appreciated!

This is the script in SWFkit Pro 2.2 :

Initialize Script:
Code:
 
// the examiner

      var exam = obj.string.substr(0, 5);

      if (exam == "$EXAM")

      {

            var index = parseInt(obj.string.substr(5));

            obj.string = FlashPlayer.getVariable("_root.examinerCard." + (index - 1));

            obj.needSub = true;

            return;     

      }
Printanswer Script:
Code:
 
// the answers 

      if (prompt == "$EXAMINER")

      {

            var index = parseInt(obj.string.substr(7));

            obj.string = FlashPlayer.getVariable("_root.examinerCard." + (index - 1));

            trace(obj.string);

            if (obj.string == "undefined") obj.string = "";

            obj.needSub = true;     

            return;     

      }
The AS in the USER-SIDE:
Code:
_root.examinerCard = new Array();

    var _l2 = 1;

    while (_l2 <= 6)

    {

        var _l3 = _root["examiner" + _l2];

        _root.examinerCard.push(_l3);

        _l2++;

    } // end while
And AS on Print Answer Button:
Code:
on (click)
{

      _root.collectExaminerCard();

      fscommand("ffish_run", "printanswer");

}
Reply With Quote
  #2 (permalink)  
Old 12-23-2005, 12:29 PM
Member
 
Join Date: May 2003
Posts: 35
Default Re:Problems with obj.string...

In Flash, examinerCard is declared as an array.

In SWFKit, you use getVariable. You have to use getArray for arrayus and getObject for objects.

Take the time to read SWFKit help about those as they work slightly differently than getVariable.

Same goes in the other direction. Use putArray and putObject. setVariables is only for the standard type of variables.

Also, when you transfer variable content with SWFKit, only string can be transfer so, if you want to transfer a number or a boolean, convert it to a string otherwise you'll get an undefined value in Flash.

ex: setVariable("_root.myNumber", aNumber.toString());
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:08 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.