Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-09-2004, 09:50 AM
Senior Member
 
Join Date: Feb 2003
Posts: 212
Default Creating a variable object

I want to make a script in ffish that appends data to an object.
The object that is used, is assigned by a variable in the flash movie.
If the object doesn't allready exist, Ffish should make a new Object with the name of the Flash-variable.
This is the code I use in flash.

Code:
// fetch the objectname from flash
HuidigeOefening = eval(FlashPlayer.getVariable("_root.HuidigeOefening"))

if (!HuidigeOefening){

***trace("no object with this name")
                // create new Object
***HuidigeOefening = new Object()
***HuidigeOefening.score = new Array();
***HuidigeOefening.datum = new Array();
***HuidigeOefening.tijd = new Array();***
}
//fetch the data to be appended to the object
HuidigeScore=FlashPlayer.getVariable("_root.HuidigeScore")
HuidigeDatum=FlashPlayer.getVariable("_level0.HuidigeDatum")
tijd=FlashPlayer.getVariable("_level0.tijd")
//append the data
HuidigeOefening.score.push(HuidigeScore)
HuidigeOefening.tijd.push(tijd)
HuidigeOefening.datum.push(HuidigeDatum)
When I test the code, a new Object is created, but it doesn't have the name of the Flashvariable, but its name is "HuidigeOefening", (which appears logic)


It seems to me that I'm missing something obvious.
Does somebody have a clue on what I'm doing wrong.
How can I make a new object with a variable name.
Reply With Quote
  #2 (permalink)  
Old 05-13-2004, 05:32 PM
Senior Member
 
Join Date: Feb 2003
Posts: 212
Default Re:Maybe a stupid question about objects.

In flash, it is possible to make a variable object like this.

Code:
_root["something"+i] = new Object()
Can this be easely translated to ffish???
Reply With Quote
  #3 (permalink)  
Old 05-17-2004, 03:41 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Creating a variable object

Hi, meester

Do you want to make an object named "_root.HuidigeOefening" in FFish script? Why do you need to do in this way?

The
Code:
_root["something"+i] = new Object()
can work in FFish like this
Code:
_root = new Object();
_root["something"+i] = new Object();
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 06:19 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.