Flash Help
Author |
Message |
Corybu
|
Posted: Fri Sep 26, 2003 1:31 pm Post subject: Flash Help |
|
|
Since there isnt one already, Ill make a thread for help on flash.
And to start, does anyone know how to have a button/movie clip that you can click and then hide?
Im thinking it would use some AS like unload movie, but im not so hot with AS... any ideas? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
krishon
|
Posted: Fri Sep 26, 2003 5:13 pm Post subject: (No subject) |
|
|
i dunno, maybe u can have a mask of some sort ;? |
|
|
|
|
|
Tony
|
Posted: Fri Sep 26, 2003 5:18 pm Post subject: (No subject) |
|
|
cant you ActionScript onClick for that button?
button.hide or something.
Then continue action desired.
Or you can just place a white box over the button |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
krishon
|
Posted: Fri Sep 26, 2003 5:19 pm Post subject: (No subject) |
|
|
lol, probably...i've never really used actionscript too much |
|
|
|
|
|
Corybu
|
Posted: Sat Sep 27, 2003 11:20 am Post subject: (No subject) |
|
|
What it is, is a game based on an inside joke between me my mom dad and aunt.
She made coffee, and when it was ready, and poured and stuff, there were grinds in it, so she was picking them out, and so were my parents, and my aunt went into the kitchen for something, and came out and my mom was still picking them out of her coffee, and my aunt said "More grinds?" I thought it was funny cause it seemed like she was asking my mom if she wanted more grinds, lol.
So I started making this game and it was a mug, filled with coffee grinds, and you had to pick them out in a certain amount of time, and if you didnt get them all, there would be a more grinds sound effect, and somone would put in more grinds.
the problem I encountered was that I drew a grind symbol, placed a few of them in the mug, copy/paste them (too lazy to manually place 30+ grinds), then when you click one grind, they all dissappear.
I dont know if it was cause the AS got put on the symbol, or if I didnt use instances right, but something messed up.
its been a while, and I havent touched that program, but I will try to do something with it soon.
any ideas would rock. |
|
|
|
|
|
Tony
|
Posted: Sun Sep 28, 2003 1:21 am Post subject: (No subject) |
|
|
well copy/paste might have something to do with it.
Can't you just write a forloop to randomly create 30 instances of the grind and place it randomly into the mug? |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Amailer
|
Posted: Sun Sep 28, 2003 1:36 am Post subject: (No subject) |
|
|
If i got you right,
you want is so that, if a person click the button...the button gets hidden?
well err if thats so,
check the attachment
i just used, go to actionscript on the button ;D sent to to frame number 2 which has the actionscript stop
(frame number 1 has the actionscript stop also)
IF THE ATTACHMENT DON'T WRK!
GO TO: http://amailer.sourceforge.net/images/test.swf |
|
|
|
|
|
Delta
|
|
|
|
|
Sponsor Sponsor
|
|
|
zylum
|
Posted: Tue Feb 17, 2004 11:08 pm Post subject: (No subject) |
|
|
a few tips...
first, you really shouldn't be putting all your code into movie clips. once you start to make complex programs, you will lose track of where all the code is located... i understand if you're still using F5 but with FMX oyu should store all your code in a layer called actions and in the first frame of that layer. another thing is that you shouldnt really use buttons. they are very limited and besides using movieclips is almost as easy and they are much more versetile...
anyways, here's an example of what i mean and hopefully it solves your problem too... by the way i just duplicated the movieclips using AS and used hitTest to check whether you clicked on the grains...
btw delta, in your if statement, you used if(something = something else) {}
remember that when you are comparing stuff in iff statements you compare with ==... |
|
|
|
|
|
Delta
|
Posted: Wed Feb 18, 2004 10:24 am Post subject: (No subject) |
|
|
Putting the code related to that movieclip into that movieclip isn't bad at all... and its alot easier to keep track of...
as for the coding....well see thats the thing... while comparing somethings... usually boolean comparison uses the '==' unless it was '=' can't remember :S but ya.... should have been fine... |
|
|
|
|
|
zylum
|
Posted: Wed Feb 18, 2004 9:20 pm Post subject: (No subject) |
|
|
if you use '=' in an if statement, you wont be comparing the two, you'll just be assigning a value to the first variable.... and now with flash mx and flash mx2, most flash programmers put all their code in the first frame of the actions layer.... only those who use flash 5 or still have'nt updated their skills put their code in movie clips.... i used to put my code into movieclips but now i see how that was really bad prcatice. you too will see this as you gain more experience... |
|
|
|
|
|
Delta
|
Posted: Wed Feb 18, 2004 10:07 pm Post subject: (No subject) |
|
|
well see thats the thing dude... say that you duplicate a new movie... that movie needs its variables... say x and y set... the best way (at least for what I'm thinking) is on (load){x=3;y=453;} especially if you don't want the code flying everywhere.... just trust me on this dude... thats a perfectly fine way of doing it... I just don't think your seeing it from the same spot I am |
|
|
|
|
|
zylum
|
Posted: Wed Feb 18, 2004 11:21 pm Post subject: (No subject) |
|
|
did you even look at the fla i posted? i dunno, i guess it's ultimately up to the programmer's preference, but if you're planning on sharing any of your projects with other people say if you're developing a game with a team, you should really get used to putting all your code in one frame -_-
also about the initializing the variables of the duplucated MC's, you could do that when you duplicate them as seen in the fla i posted... both our code does the same thing but mine is at an easily accessible area. what happens if you have moviesclips within your movieclips that need code... that will get really messy... |
|
|
|
|
|
|
|