This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-12-09 16:13:15

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Save instance variable of stage in file format?

In Insanity, I added an instance variable to the stage (of type dictionary). How would I make it save with the file?


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#2 2012-12-09 16:22:19

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Save instance variable of stage in file format?

Never mind, I figured it out.

In Scratch-Objects -> ScratchStageMorph -> object i/o -> storeFieldsOn:, I just add the variable I want, telling it to save that variable.
Then, in Scratch-Objects -> ScratchStageMorph -> object i/o -> initFieldsFrom:version:, I add the variable I want again at the end, telling it to read the variable from the project.

Last edited by jvvg (2012-12-09 16:24:20)


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#3 2012-12-09 18:07:00

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Save instance variable of stage in file format?

Closed by request of the topic owner.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

Board footer