1 Replies - 870 Views - Last Post: 01 March 2008 - 04:25 AM

#1 Akelo  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 96
  • Joined: 12-December 07

Flash Buttons

Post icon  Posted 01 February 2008 - 01:12 PM

I'm trying to create a navbar, and I create a button, and in the button it has 3 layers to it (text, reflection...which I'm still puzzling over, and color). How would I make this button a template, so that when I change the text in the layer, it does change ALL of the instances at the same time, just the one that is currently being edited? Thanks for the help in advance :).

Is This A Good Question/Topic? 0
  • +

Replies To: Flash Buttons

#2 lost child  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 18
  • Joined: 01-March 08

Re: Flash Buttons

Posted 01 March 2008 - 04:25 AM

In the future, please indicate the version of ActionScript that you are using (2 or 3). :)
At this point, I can only help you with ActionScript 2

With that being said...


Select the text field inside the button and using the Properties window apply the following settings to it:
  • Set text type to Dynamic
  • In the Instance Name field type buttonText
  • Click the Embed button and embed characters according to your needs (Basic Latin should do fine).
Now, go up one level and select the button itself.

From here you can do it either of the two ways:

A.
With the button selected, open the Properties window and verify that Instance behavior is NOT set to Graphic
With the button still selected, open the Actions window and paste the following code there:
onClipEvent(load)
	{
		buttonText.text = "home";
	}

Make a copy of that button, select it, paste the same code in the actions window but change "home" to anything you like. Repeat this procedure for as many buttons as you need.

B.
Alternatively, you can first make copies of the button, (again make sure they are not set to be Graphic), give each duplicate and instance name. Create a new empty layer, open the Actions window.
Now, assuming you created 3 copies of the button and gave them the following instance names : home, products, contact, write the following ActionScript code:
home.buttonText.text = "HOME";
products.buttonText.text = "PRODUCTS";
contact.buttonText.text = "CONTACT";

The changes to the buttons' texts will not be reflected until you test or export the movie.
Questions? B)

Attached File(s)

  • Attached File  Akelo.zip (4.84K)
    Number of downloads: 52

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1