I am going to have many computers on the map. They will be instances of the same tile. When you click on each computer it will show a different message depending on which computer was clicked.
I am going to be changing the info in the popup often, so I would like to store the message in a database connected to a unique ID to the computer.
So my question is:
What is the best method to pass the "I clicked on computer 6" info?
Do I have to make each computer a unique skin and use custom params?
Should I reference the Tile instance "name" somehow and run it through a case in the main FLA file.
Should I build the code into the library instance of the computer?
I just want to make sure that OS does not have a way I SHOULD be going about this before I create my own.
Thank you!
Prefered method of "unique" tile interaction?
We would do like this: create different tiles, one per computer, assigning them the same skin (className) but different customParams and objectId attributes; add the setCustomParams(params:Array) to your skin's movieclip so you can save the specific parameter's inside the skin itself, and retrieve them when the click event is fired.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Hello,
I wanted to try it too, but even if ranch example works and I have copied this code:
stop()
function setCustomParams(params:Array):void
{
trace("asdasdasdasdsA");
var dir:int = int(params[0]) + 1
this.gotoAndStop(dir)
}
in the first frame of the exported skin of my application, I didn't manage to make it working.
Do you have any clue why? I have set the customParams in the tile too. are there other mandatory stuff I have to do? Thank you for your hints.
I wanted to try it too, but even if ranch example works and I have copied this code:
stop()
function setCustomParams(params:Array):void
{
trace("asdasdasdasdsA");
var dir:int = int(params[0]) + 1
this.gotoAndStop(dir)
}
in the first frame of the exported skin of my application, I didn't manage to make it working.
Do you have any clue why? I have set the customParams in the tile too. are there other mandatory stuff I have to do? Thank you for your hints.
Last edited by nig3d on 15 Oct 2008, 10:00, edited 2 times in total.
no hints?
Actually I take the chance to ask you something related, I got curious about this topic because I wanted to exploit this function to make an hacky thing, so I'd like to know if in your opinion it could work.
I wanted to test, but I didn't manage to make the application call this function yet, if I can use the setCustomParams call to deactivate the mouse clicking through the parent.parent.disableMouse trick.
something like
if (params[0] = "disableMe")
parent.parent.disableMouse = true.
It would be great for our purposes.
Actually I take the chance to ask you something related, I got curious about this topic because I wanted to exploit this function to make an hacky thing, so I'd like to know if in your opinion it could work.
I wanted to test, but I didn't manage to make the application call this function yet, if I can use the setCustomParams call to deactivate the mouse clicking through the parent.parent.disableMouse trick.
something like
if (params[0] = "disableMe")
parent.parent.disableMouse = true.
It would be great for our purposes.
Last edited by nig3d on 17 Oct 2008, 12:47, edited 1 time in total.