- Forum
- Reviews
- Cool Sites
- [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [
-
Retired Mod
[QUOTE]Originally posted by Da enforcer
Originally posted by aversion
Code:
// stop clip running
onClipEvent(load){
gotoAndStop(1);
}
// move clip with mouse movement
onClipEvent(enterFrame){
goto = Math.round(_root._xmouse/10);
gotoAndStop(goto);
}
Help! Hiya. Is this code for flash 6? Im a newbie and cannot get the code to work. I dont know either where the code needs to be. Does it need to be within the movieclip or outside attached to the clip. Sorry if these are stupid questions but as i said im a newbie and am having alittle trouble with it. Thanks alot
clip events are 'attached' to the clip's instance on the stage. You can set them dynamically but here I am just attaching it to a clip I dragged from the library.
right click on your clip on the stage and select actions, then enter that code in the actions window. Alternatively just click on the clip to focus flash's attention on it and write into the actions window.
you might have to adjust the code a little for your clip, as I say above I have 20 frames in my clip and the movie is 200 pixels wide. So for each 10 pixels the mouse moves across the movie I advance my clip's timeline by one frame. You will have to work out what values you need for your own movie if the sizes are different.
It should work in flash 5 just fine.
-
Senior Member
Im not using flash 5....im using MX
When i paste the code it tells me i have a syntax error
-
Retired Mod
I don't think you're putting it in the right place, check out this mx FLA, I just copy and pasted the code and it works fine
-
Senior Member
thanks mate ill take alook now
-
wow, that site was VERY nice... i spent about 10 minutes just playing with the header.
there was a flaskit movie on how to do those things, i cant find it now though...
i used it on one of my sites, but not nearly as good as that one.
the site reminds me alot of http://www.mjau-mjau.com
-
Senior Member
That's some phat sh...., I've never seen such talent!!!
-
Enter the Flash Dragon
What can you say! Its what we all try to do...
Be the one!
-
...
Originally posted by aversion
there's another SWF i saw ages ago, last year I think that uses the same technique we've been talking about and to great effect also.
go to http://www.ni9e.com/ and click on the second little square button at the bottom from the right, title browser d. I'm guessing this one was done by mapping a browser sceenshot onto a 3d model as a texture, but I could be wrong, it's a neat trick however it was done.
this is the code aversion
onClipEvent (enterFrame) {
oldx = _xmouse;
if ((_root.ex < 256) && (_root.ex > 206)) {
_root.text.browser.gotoAndPlay("explorer");
}
if ((_root.ex > 257) && (_root.ex < 307)) {
_root.text.browser.gotoAndPlay("netscape");
}
setProperty("_root.drag", _x , _xmouse + 40);
_root.ex = int (_xmouse);
if ((_xmouse < 136) || (_xmouse > 437)) {
_root.drag.gotoAndStop("zoom");
} else {
_root.drag.gotoAndStop("rotate");
}
setProperty("_root.text.line01", _y , (_ymouse / -2) + 115);
setProperty("_root.text.line01large", _y , (_ymouse / -4) + 75);
setProperty("_root.text.line02", _y , (_ymouse / 2) - 125);
setProperty("_root.text.line02large", _y , (_ymouse / 4) + 75);
setProperty("_root.text.line03", _y , (_ymouse / -2) + 100);
setProperty("_root.text.line03large", _y , (_ymouse / -4) + 75);
setProperty("_root.text.line04", _y , (_ymouse / 2) - 150);
setProperty("_root.text.line04large", _y , (_ymouse / 4) + 75);
setProperty("_root.drag", _y , 180);
if (_xmouse < 62) {
_root.main.gotoAndStop(1);
}
if ((_xmouse >= 62) && (_xmouse < 77)) {
_root.main.gotoAndStop(3);
}
if ((_xmouse >= 77) && (_xmouse < 92)) {
_root.main.gotoAndStop(5);
}
if ((_xmouse >= 92) && (_xmouse < 107)) {
_root.main.gotoAndStop(7);
}
if ((_xmouse >= 107) && (_xmouse < 122)) {
_root.main.gotoAndStop(9);
}
if ((_xmouse >= 122) && (_xmouse < 137)) {
_root.main.gotoAndStop(11);
}
if ((_xmouse >= 137) && (_xmouse < 152)) {
_root.main.gotoAndStop(13);
}
if ((_xmouse >= 152) && (_xmouse < 167)) {
_root.main.gotoAndStop(15);
}
if ((_xmouse >= 167) && (_xmouse < 182)) {
_root.main.gotoAndStop(17);
}
if ((_xmouse >= 182) && (_xmouse < 197)) {
_root.main.gotoAndStop(19);
}
if ((_xmouse >= 197) && (_xmouse < 212)) {
_root.main.gotoAndStop(21);
}
if ((_xmouse >= 212) && (_xmouse < 227)) {
_root.main.gotoAndStop(23);
}
if ((_xmouse >= 227) && (_xmouse < 242)) {
_root.main.gotoAndStop(25);
}
if ((_xmouse >= 242) && (_xmouse < 257)) {
_root.main.gotoAndStop(27);
}
if ((_xmouse >= 257) && (_xmouse < 272)) {
_root.main.gotoAndStop(29);
}
if ((_xmouse >= 272) && (_xmouse < 287)) {
_root.main.gotoAndStop(31);
}
if ((_xmouse >= 287) && (_xmouse < 302)) {
_root.main.gotoAndStop(33);
}
if ((_xmouse >= 302) && (_xmouse < 317)) {
_root.main.gotoAndStop(35);
}
if ((_xmouse >= 317) && (_xmouse < 332)) {
_root.main.gotoAndStop(37);
}
if ((_xmouse >= 332) && (_xmouse < 347)) {
_root.main.gotoAndStop(39);
}
if ((_xmouse >= 347) && (_xmouse < 362)) {
_root.main.gotoAndStop(41);
}
if ((_xmouse >= 362) && (_xmouse < 377)) {
_root.main.gotoAndStop(43);
}
if ((_xmouse >= 377) && (_xmouse < 392)) {
_root.main.gotoAndStop(45);
}
if ((_xmouse >= 392) && (_xmouse < 407)) {
_root.main.gotoAndStop(47);
}
if ((_xmouse >= 407) && (_xmouse < 422)) {
_root.main.gotoAndStop(49);
}
if ((_xmouse >= 422) && (_xmouse < 437)) {
_root.main.gotoAndStop(51);
}
if ((_xmouse >= 437) && (_xmouse < 452)) {
_root.main.gotoAndStop(53);
}
if ((_xmouse >= 452) && (_xmouse < 467)) {
_root.main.gotoAndStop(55);
}
if ((_xmouse >= 467) && (_xmouse < 482)) {
_root.main.gotoAndStop(57);
}
if ((_xmouse >= 482) && (_xmouse < 497)) {
_root.main.gotoAndStop(59);
}
if (_xmouse >= 497) {
_root.main.gotoAndStop(61);
}
}
onClipEvent (load) {
newx = "_xmouse";
}
------------------------------------------------------
that is the code they used i think yours is easier
-
Retired Mod
wow, that's pretty hefty code, I mean, mine does do the same thing as all those if statements and set properties... as long as you know the width of your movie in pixels and the number of frames in your movie clip then you can just divide the mouse position by a number to get the same effect... maybe they have their reasons I'm certainly no expert.
-
Webmaster
Ok..now i feel like a bad web-designer **** dude !! that's some heavy code hehe
-
NZ
The site is terrible ! What a color scheme ! Its just too dull. Broadbands only.
(Besides, someone'z got to be a different..heh heh)
-
Retired Mod
Originally posted by Johnny Shiro
Ok..now i feel like a bad web-designer **** dude !! that's some heavy code hehe
yeah, I really don't understand why they did it the long way like that, all those if statements... crazy
-
that's a sweet site!... i'm gonna use some ideas to improve my site!
-
Great, Daddy-O!
crap on a stick!
damn thats a good site!
I really really like the music, it brings great amosphere combined with the hot chick
-
perfect site
the colour sceheme, effects and mood of the design are perfect for the subject. lacks nothing, needs nothing.
aversion = thanks for that code!!!
i tried to recreate the effect using onMouseMove - but the prob was that the clip only played forward regardless of which way i moved my mouse - i see where the math comes in
jose gonzalez
-
...
dam...
404 Just my luck
Each success only buys an entrance ticket to a more difficult problem
-
uh, 404 for me too. and i really wanna see this, its sounds so good.(im guessing its like the southpark example posted earlier in the thread??)
oh, and btw aversion your very right. that code was ridiculously large. not only is it overkill, but wasting TONS of cpu power on running throuhg ALL those if statements.
-
I am forced to make up a new adjective to describe this site......
Scrumtrillescent
-
raising hell to the next level
what in the hell...??? i just get a mere 400 error
-
FK's Homer J.
hmm..i dunno i guess the site is down too bad
"Be quiet, Brain, or I'll stab you with a Q-tip" -Homer
"Whos your daddy and what does he do?" -Arnold S.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|