Flash Forum, Tutorials, Education & Training

 


Flash Tutorials


Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> [cs3/as2] Button to change fonts in a dynamic box.
tivaelydoc
post Sep 8 2008, 10:03 PM
Post #1


Newbie
Group Icon

Group: Members
Posts: 16
Joined: 28-August 07
Member No.: 3,450



I have a couple buttons that generate text but I want each of them to use a different font. This is what I tried:

SWF:

http://tivaelydoc.110mb.com/fontchanger.swf

FLA:

http://tivaelydoc.110mb.com/fontchanger.fla

AS:

On the frame:
CODE
onEnterFrame = function () {
    var Format:TextFormat = new TextFormat();
    Format.font = (_root.box.getValue());
    YourTextBox.setTextFormat(Format);
};
stop();
a = ["Bob", "Jim", "Dave"];
b = ["went", "ran", "danced"];
c = ["at the fair.", "out in the patio.", "next door."];


Button:

CODE
on (release)
{
    var box = new Array("Arial");
    var sentence = new Array(a[random(a.length)], b[random(b.length)], c[random(c.length)]);
    result = "";
    var i = 0;
    while (i < sentence.length)
    {
        result = result + (sentence[i] + " ");
        ++i;
    }
}


This post has been edited by tivaelydoc: Sep 9 2008, 04:42 AM
Go to the top of the page
 
+Quote Post
Oldnewbie
post Sep 9 2008, 01:18 AM
Post #2


Wan Kenobi!
Group Icon

Group: Moderator
Posts: 3,307
Joined: 2-November 05
From: Montréal, Québec.
Member No.: 826



Both links end up on 404's...


--------------------
Go to the top of the page
 
+Quote Post
tivaelydoc
post Sep 9 2008, 04:42 AM
Post #3


Newbie
Group Icon

Group: Members
Posts: 16
Joined: 28-August 07
Member No.: 3,450



Strange, somehow the extensions got put outside of the url.
Go to the top of the page
 
+Quote Post

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

 





> Webwasp Flash Forums
New Posts

RSS Lo-Fi Version Time is now: 23rd July 2014 - 05:45 AM