Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Floating Letters That Load At Random - Banner, SwishMax - Intermediate
RedDragon
post Feb 23 2005, 12:49 AM
Post #1


insert coin
Group Icon
Group: Main Team
Posts: 5,344
Joined: 24-May 04
From: Maastricht
Member No.: 35





Make an animated banner with a random text that changes every time you refresh the page!

Idea and realisation by Carlos (cmonney), I just wrote the tutorial smile.gif




1. open swishmax and a new movie with dimensions 280 x 50

2. make a shape covering the entire movie (so dimensions again 280 x 50)
give it a name 'trigger', we will add the script later

3. select text in the toolsmenu and type a letter, for example the 'W' I used in the example.
center this one to the movie, give it a name "label" and make sure you check target. Furthermore make sure its a Dynamic text field and the alignment is set to centered. See the picture below.



Use any font settings you want, I used verdana 12pt with a blue colour.

4. Convert the text to a sprite and give it the name "letter"

5. Group this sprite as a sprite and give it the name "char"

Your outline should look like this now:



6. add the following script to it in expert mode

CODE
onload () {
_text = _root.legend[random(5)];
tl = length(_text);
space = 12;
xx = -(tl/2)*space;
z = 0;
for (i=0; i<tl; i++) {
letter.duplicateSprite("l"+i,i);
l = this["l"+i];
l.xf = xx+(space*(i-1));
l.yf = 0;
l.xt = random(300)-150;
l.yt = random(100)-50;
l.letter = _text.substr(i,1);
}
letter._visible = false;
_1 = 150;
_2 = 100;
}
onEnterFrame() {
for (i=0; i<tl; i++) {
l = this["l"+i];
l._x += (l.xt-l._x)/10;
l._y += (l.yt-l._y)/10;
if (l._x<1 || l._x>-1) {
l.xt = random(_1)-(_1/2)+(l.xf*z);
l.yt = random(_2)-(_2/2)+(l.yf*z);
}
}
}


7. Select the shape "trigger" and add the following script in expert mode:

CODE
on (rollOver) {
char._1 = 10;
char._2 = 10;
char.z = 1;
}
on (rollOut,dragOut,releaseOutside) {
char._1 = 150;
char._2 = 100;
char.z = 0;
}
on (press) {
   getURL("http://www.13dots.com","_blank");
}


where "http://www.13dots.com" is the url you want to link the banner to

8. Now we will add the banner text.

Select the scene and add the following text in expert mode:

CODE
onload () {
legend = new Array;
legend[0] = "www.13dots.com";
legend[1] = "photoshop";
legend[2] = "swishmax";
legend[3] = "tutorials";
legend[4] = "downloads";
}


change the descriptions to suit your needs!




edit the scripting to add more or less fields, adjust speed, distance etc.

Good luck!
 
+Quote Post  Go to the top of the page
pittiv
post Mar 14 2008, 07:18 AM
Post #2


New Member
Group Icon
Group: Member
Posts: 2
Joined: 14-March 08
From: 53773 Hennef - Germany
Member No.: 19,793





Hi...great !
...is this also possible, to make it with round buttons in different color and the possibility to link to other sites or events instead the letters ?
I would like to make a menu in this way
 
+Quote Post  Go to the top of the page

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version Time is now: 29th July 2010 - 10:57 PM
Life Insurance | Mortgages | Compare Savings | Life Insurance | WoW Gold