need help sugestions

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

keagan
Posts: 32
Joined: 13 Nov 2006, 06:34

need help sugestions

Postby keagan » 11 Jan 2007, 00:21

ok heres my plan , im needing like a feature were users can start with building material ""movie clips/blocks" such as tvs furniture ect, and be able to build there own home ""crib"" and then have the function to save it were then other users can come in there home and see all the stuff theve selected and placed in there home, how do i go about doing this, if you would like a short example check out club penguin how you can make houses there
im not trying to make a ""full"" vertual world, just standalone swf on each users page, displaying there home and everything in it, somethings in the home will be interactive, and they can add stuff acording to there rating points which they can earn by other users rating there home, well hope this explains well enough, all i need is sugestions on how to let users cunstruct, add objects, and save there home , THANKS everyone in advance for the replys :D
User avatar
Carl
Posts: 36
Joined: 22 Dec 2006, 20:40
Location: New York
Contact:

Sounds like a job for a database

Postby Carl » 11 Jan 2007, 01:10

It sounds like this functionality only needs a database. Here's an overview:

Let the user arrange his room. As he does this each furniture he selects is added to an array. When he places it the position is also added to the array.

Save the array containing the name of the crib owner, each piece of furniture and its position in the room. Send it to the database.

Then when a user looks at the room, the swf asks the server for the room array, based on the owner, and places each piece of furniture. You could store all the furniture in one movieclip and jump to a frame, or you could dynamically load in a png into each furniture.
Carl Lydon
Illustrator, animator, programmer
----------------------------------------
www.gametrust.com
www.chamberofchat.com
keagan
Posts: 32
Joined: 13 Nov 2006, 06:34

thanks

Postby keagan » 11 Jan 2007, 03:39

yea thats what i was leaning torwards like a database but the bad thing is
im very new to arrays sorta odd that ive been working with flash for two years now but havent learned arrays yet? lol theyve always cunbfused me may someone please provide a example maybe some actionscript and i promise any copyied or snipped actionscript i will post there name at the botom of the loading page with all the names of the creators :D
User avatar
Carl
Posts: 36
Joined: 22 Dec 2006, 20:40
Location: New York
Contact:

The array might look something like this

Postby Carl » 11 Jan 2007, 18:06

The array might look something like this.


CribArray=[ ["couch",32,128] , ["chair1",200,94] , ["rug",332,100] ]

Although I would probably use number sfor the furniture instead of names because it's smaller to send and retrieve than a string, and the number can be used ot indicate a frame in a movieclip.

Anyway, to build the array, have a script attached to a save button, that loops (i) through all of the furniture movie clips and determines the type of furniture and the current position for each one. Maybe all your furniture on the screen are named "furniMC0","furniMC1", "furniMC2" etc

Then do something like:


furni=[]
furni.push("couch")
furni.push(_root["furniMC"+i]._x)
furni.push(_root["furniMC"+i]._y)
CribArray.push(furni)

When you retrieve the array from the database, loop through the array and retrieve the data

furni= CribArray[i]
Lname=furni[0]
Lx=furni[1]
Ly=furni[2]


Then have code to duplicate a movieclip, send it to the correct frame based ont he furni in question, and position the MC based on Lx and Ly.
Carl Lydon

Illustrator, animator, programmer

----------------------------------------

www.gametrust.com

www.chamberofchat.com
keagan
Posts: 32
Joined: 13 Nov 2006, 06:34

thank you

Postby keagan » 12 Jan 2007, 23:27

thanks that was very helpfull
still cinfised on the array in actionscript but ill read up on my books gosh cant get it forced in my head :?

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 25 guests