keymistress
12-09-2007, 02:49 PM
hello everybody,
this effect isn't new but i've never gotten round to figuring how it was done, nor found the right keywords to search for a tutorial.
examples:
http://www.havaianas.com/
http://www.cathybeck.com/
i'm guessing this is one HUGE movieclip and it moves onclick the smaller movieclips for each section.
anybody has a tutorial for this? i'd be grateful!
Sephur
12-09-2007, 06:07 PM
Well, first off. I don't know if this holds true to all of the versions of flash, but in MX 2004, it certainly doesn't let you make Movie clips larger than some number between 2000 and 3000 pixels in height or width. I have yet to test exact numbers. All I knew was that I couldn't get a movieclip beyond 3000 pixels manually. Therefore, I found a lazy way around all of that.
firstly, test out a few numbers by typing into a meager movieclip's coding window:
onClipEvent(load){
magnitude = 500;
}
onClipEvent(enterFrame){
this._xscale = magnitude;
this._yscale = magnitude;
}
placement of the scale = magnitude;'s can be done in either the load or the enterFrame event handlers. Personally, I put them in the enterFrame because at this point, it can't hurt you any. It's when you start having so much going on in the screen that your computer's lagging that putting it in load really needs to be considered.
now, you have a HUGE Movieclip, and it can most definitely be bigger than 3000 pixels wide and high. It just plain allows for more room.
Well, this is all fine and dandy, but now the scale is out of proportion and everything's quite ridiculous looking, especially if you had other movieclips and buttons external to JUST the huge movieclip.
I can't help you with how ridiculous it looks. That's something you have to work out on your own. My thought on this is to magnify the editing screen to magnitude% and then draw as you'd see it in that frame of reference.
however, lets say you need some coding. I did this on a 2D action game I'm working on, and if I had been a little more emotional, I would have gone to sleep crying every night I worked on it. Point is, I got it done, and yes, it was kinda hard. However, the theory's pretty simple, and if you're doing this with something that doesn't require arrays, classes, and LARGE scope, then you'll have no problem working with it.
essentially what you'll do is make a copy of the original meager movie clip, putting everything such as movieclips or buttons in their respective locations. Eventually, if anything needs to be made invisible, you can do that in the properties window, no big whoop, but for testing purposes you should have everything visible.
Once you're done making what I like to call, "the events layer," make a new movieclip called something like, "totalmovieclip" because it's going to house both the HUGE movieclip and the "events layer". It's also notable to say that you MUST copy the coding on the HUGE movieclip onto the instance you have inside totalmovieclip. Also, put the same coding into the events lay
onClipEvent(enterFrame){
this._xscale = _parent.HUGEMovieClip.magnitude;
this._yscale = _parent.HUGEMovieClip.magnitude;
}
once you're done, on each component of the events layer you need the _x,_y values of, send it from the code ON the movieclip to a variable in the total movie clip or anywhere else you'd need that variable. However, you'll have to state it like this:
_parent._parent.Button1x = (this._x*_parent.HugeMovieClip.magnitude/100 )
this, because of weird programming hullabaloo (my word for 'stuff') is necessary EVEN THOUGH both of the movieclips have been stretched by a value of magnitude%. IT still doesn't seem to pick up on the fact that they're MUCH MUCH bigger. It probably makes sense if we think about it, but let's not and just accept it as truth.
with this, you get ACTUAL coordinates of the components, and various things like hitTests or conditions on "If( is in screen )" (give or take some abbreviate d ideas :p ) can be used.
So. This probably did not answer your question, but in thinking about it, it's definitely prevalent to tell you that if you're working with huge movieclips, it might not be able to get as huge as you think, manually. Also, everything you do in here depends on what you'll actually be doing with the coding involved. If it's more complicated then what I've specified, it'll take a lot of thought. If its simpler, you can probably neglect a few steps.
Good luck!
- Sephur
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.