|
|||
|
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)
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. |
|
|||
|
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() Code:
_root = new Object(); _root["something"+i] = new Object(); |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|