View Full Version : Mercedes site with cool effects - how is it done?
wallitzio
February 6th, 2006, 05:02 AM
Apologies if this is posted in the wrong place but I was wondering if any of you guys knew how to achieve this text effect.
If you go to http://www.a-to-s.co.uk/home.php and the click on the letter 'o' - how is that done?
Thanks
Owen
gvozden
February 6th, 2006, 06:56 AM
if you think on dropping text effect
this way you can do it for sure, I will post pseudocode
rot = 0;
on EnterFrame {
mX = getMouseX // getting mouse coordinates
mY = getMouseY
duplicateText(sourceText, NewText, _level) // duplicating text
setNewTextPos(mX,mY) // setting text position
scaleOut(NewText, rot) // calling function for scaling out
rot++ // increasing rot which help us to rotate in different direction
}
function scaleOut(obj, rot) {
scale = 0.9; // scaling is 0.9 at the beggining
if (rot%2==0) { // rotating in opposite direction every second time
obj.rotation += 0.1
} else {
obj.rotation -= 0.1
}
obj.onEnterFrame {
obj.xscale = scale // scale the object
obj.yscale = scale
scale = scale - 0.1
if (scale<0.1) { // if object is too small we remove it
delete obj.onEnterFrame
delete obj
}
}
hope you will succedd to make a real demo from this pseudo code
it will be interesting to resolve it :)
wallitzio
February 6th, 2006, 08:49 AM
Cheers for the code!
Can't get it to work though (am using Flash 8 Pro), it throws up four script errors but i'll keep trying with it!
Any other suggestions/help will be gratefully recieved!
Thanks
Owen
**Error** Symbol=copy, layer=Layer 1, frame=1:Line 2: Mouse events are permitted only for button instances
on EnterFrame {
**Error** Symbol=copy, layer=Layer 1, frame=1:Line 21: Syntax error.
obj.onEnterFrame {
**Error** Symbol=copy, layer=Layer 1, frame=1:Line 11: Statement block must be terminated by '}'
function scaleOut(obj, rot) {
**Error** Symbol=copy, layer=Layer 1, frame=1:Line 32: Syntax error.
}
Total ActionScript Errors: 4 Reported Errors: 4
gvozden
February 6th, 2006, 09:03 AM
seems to me you don't know what pseudo code is
it's not real code, you have to rework it so it feets actionscript
but it's really easy if you know action script a little bit
I will now take my precious time to write a code but it's not good for you to just copy paste code
wallitzio
February 6th, 2006, 09:53 AM
I must confess I was a bit confused by the word 'pseudo' ;o)
Don't worry if you are busy about scripting out the code - am happy to work on it myself - just wanted a push in the right direction!
Thanks again!
Owen
seems to me you don't know what pseudo code is
it's not real code, you have to rework it so it feets actionscript
but it's really easy if you know action script a little bit
I will now take my precious time to write a code but it's not good for you to just copy paste code
gvozden
February 6th, 2006, 10:18 AM
okay
I did something that is like that
I didn't have time to script the falling of the text but this is very similar
it's just simple example enjoy
wallitzio
February 6th, 2006, 12:02 PM
Thats quite a neat effect! However what I was after was to get the individual characters in the paragraph to wiggle around and move away from the mouse as you hover near them.
Now I guess you could put an individual script on each letter but is there some way of taking all the letters in a group of text and applying an effect similar to the mercedes one to all the letters at once?
Cheers
Owen
okay
I did something that is like that
I didn't have time to script the falling of the text but this is very similar
it's just simple example enjoy
gvozden
February 6th, 2006, 06:54 PM
you can do effect as a function on one letter and then apply it to all letters
but there is no way of keeping letters in one textfield and doing effect like that
takeru
February 7th, 2006, 03:07 AM
owh. seen the site and i know what u mean wallitzio.
u guys wait till the site loads with the letter A - S at the bottom..
then click on letter 'Ostrich', u'll see a very nice feather effect.
i think it uses magnetic effect and stuff :p
wallitzio
February 8th, 2006, 08:39 AM
Well, i've found some code to do this.
Its a bit of actionscript that places a text field on stage and animates the individual characters.
What I want to do though is have this play on the first frame then remove the movie clip on the second frame.
I've tried this method HelloWorld.removeMovieClip(); but it doesn't want to play ball, macromedia are talking about using the Delegate class to remove it but its gone a bit over my head! ;o)
Hopefully someone here can help!
Thanks
Owen
Loststarz
February 8th, 2006, 02:49 PM
Well, i've found some code to do this.
Its a bit of actionscript that places a text field on stage and animates the individual characters.
What I want to do though is have this play on the first frame then remove the movie clip on the second frame.
I've tried this method HelloWorld.removeMovieClip(); but it doesn't want to play ball, macromedia are talking about using the Delegate class to remove it but its gone a bit over my head! ;o)
Hopefully someone here can help!
Thanks
Owen
Can you attach it on another level as an external .swf? Then you could just unload the level.
Lindquist
February 8th, 2006, 04:38 PM
Just put this on the first frame:
var temp:MovieClip = this.createEmptyMovieClip("temp", getNextHighestDepth());
HelloWorld.main(temp);
function wait() {
gotoAndStop(2);
}
myTimer = setInterval(wait, 2000);
stop();
And this on the second:
removeMovieClip(temp);
stop();
It was sending "_root" or "this" to the class to create the target instance and it's not really recommended to remove the _root MovieClip :)
wallitzio
February 9th, 2006, 04:23 AM
Brilliant - thank you very much!
Owen
Just put this on the first frame:
ActionScript Code:
</p>
<p>var temp:MovieClip = this.createEmptyMovieClip("temp", getNextHighestDepth());</p>
<p>HelloWorld.main(temp);</p>
<p>function wait() {</p>
<p> gotoAndStop(2);</p>
<p>}</p>
<p>myTimer = setInterval(wait, 2000);</p>
<p>stop();</p>
<p>
And this on the second:
ActionScript Code:
</p>
<p>removeMovieClip(temp);</p>
<p>stop();</p>
<p>
It was sending "_root" or "this" to the class to create the target instance and it's not really recommended to remove the _root MovieClip :)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.