View Full Version : [AS2] Dress Up Game Button Problems
Dreamias
04-18-2009, 06:44 AM
Okay well,
I'm attempting to create my first dress up game to try and introduce myself to action script.
But I ran into a problem.
I put the code into each item that I had made a button, that I wished to move separately. But when I tested it, they moved as one, they were not separate at all.
I don't know what I'm doing wrong, I don't understand action script just yet so I looked it up on the internet.
I'm not sure if it's the script or if I'm missing a step.
I'm using Adobe Flash 2.0.
I'm not sure if this helps or not but when I have one thing on the blank page it works.
Please assist me,
Thank you for your time.
kkbbcute
04-18-2009, 06:58 AM
Which exact part of the game is not working? Are you referring to the clicking and dragging of the clothes, etc?
Maybe you could post some pics/your source ;)
Dreamias
04-18-2009, 07:02 AM
Well, I haven't actually posted the actual clothing into flash yet.
But I was practicing with basic shapes to make sure it worked.
and My source of the code is this:
http://freelanceflashgames.com/news/2009/02/15/how-to-make-a-dress-up-game/
I'm sorry if this isn't very helpful.
And yes it's the dragging of the clothing.
When I try to drag just a circle the square gets dragged along with it.
Dreamias
04-18-2009, 07:34 AM
Which exact part of the game is not working? Are you referring to the clicking and dragging of the clothes, etc?
Maybe you could post some pics/your source ;)
I'd show you better with a working example but I don't really know how to send it here or to winzip because I've yet to figure it out.
nikneven
04-18-2009, 07:36 AM
Did you give each movie clip a unique instance name?
Dreamias
04-18-2009, 07:38 AM
Did you give each movie clip a unique instance name?
So you can use movie clip then?
I was using button.
I'm very sorry to ask but I've looked everywhere for a good explanation about instance names but I haven't found one yet.
How do you give it an instance name?
nikneven
04-18-2009, 07:48 AM
click on your button. On the left side of the properties window there is a drop down box that will say "button" if you have clicked on a button. Under that is a field that says <Instance Name>. Click in there and give each button a unique name. And give this tutorial (http://www.actionscript.org/resources/articles/16/1/Instance-Names/Page1.html) a try.
Dreamias
04-18-2009, 07:58 AM
click on your button. On the left side of the properties window there is a drop down box that will say "button" if you have clicked on a button. Under that is a field that says <Instance Name>. Click in there and give each button a unique name. And give this tutorial (http://www.actionscript.org/resources/articles/16/1/Instance-Names/Page1.html) a try.
Thank you very much.
Because they now have an instance name I can type their name into the action script. So with this they will all move separately.
So again I thank you.
My problem is solved.
kkbbcute
04-18-2009, 08:04 AM
click on your button. On the left side of the properties window there is a drop down box that will say "button" if you have clicked on a button. Under that is a field that says <Instance Name>. Click in there and give each button a unique name. And give this tutorial (http://www.actionscript.org/resources/articles/16/1/Instance-Names/Page1.html) a try.
Don't use buttons! Use movieclips, they allow for more flexibility later. ;)
Anyway, good to see that your problem is solved.
jamesmultimedia
04-18-2009, 05:17 PM
Are you using the same button multiple times? If so, double click inside button, copy up state artwork, go back to parent timeline and paste artwork and convert to new symbol. Click once on artwork and in property panel on bottom, give different instance name to your symbol.
Sometimes when I create button symbols, I have to put code on top of button not on an actions layer... don't know why, just know it works.
Hope this helps.
kkbbcute
04-19-2009, 03:44 AM
Sometimes when I create button symbols, I have to put code on top of button not on an actions layer... don't know why, just know it works.
That's just the way it works, trying to refer to a button from a frame will just return a syntax error. Which is why I like to use MCs instead of buttons, that way, you can put the script on the frame, making everything that much easier to find.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.