Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 03-23-2006, 02:25 AM   #1
Registered User
Join Date: Mar 2006
Posts: 5
Question how to duplicate buttons so that they...

how do you duplicate a button so that it still has the actions you gave it?

or do i have to give links to each and every button separately?
iflashyou is offline   Reply With Quote
Old 03-25-2006, 03:42 AM   #2
Grant B
Actionscript Struggler
Join Date: Sep 2005
Posts: 92

You can do what you want.

Ideally - you would start to use movie clips as buttons as you can do much more with them.

If you have an instance of something in the library - right click on the library item and choose duplicate. Any actionscript contained within that item will also be duplicated.

It depends on what you are doing or plan to do. Sometimes it pays to have seperate functions for each button and call those functions from the main timeline. (not forgetting to give each movie clip an instance name in the properties field.) But you can basically do what you want. Movie clips as buttons will give you more scope.

http://www.kirupa.com is a great place to learn both the basics and the advanced stuff. Get used to visiting that site and using the search facility. http://search.atomz.com/search/?sp-a...p-w-control=1;
Grant B is offline   Reply With Quote
Old 03-25-2006, 04:08 AM   #3
Game On
sophistikat's Avatar
Join Date: Mar 2005
Location: Barrie, ON
Posts: 2,535

you can't but there are methods around this. why do you want to duplicate your buttons and why would you want the duplicated button to have the same code as the original?

not as simple as
ActionScript Code:
// original buttons onPress handler my_btn.onPress = function () {     trace(this._name); } // duplicate my_btn.duplicateMovieClip("btn2", _root.getNextHighestDepth(), {_x: 200});
can work
ActionScript Code:
function btnPress () {     trace("btn pressed"); } // original buttons onPress handler my_btn.onPress = function () {     btnPress(); } // duplicate my_btn.duplicateMovieClip("btn2", _root.getNextHighestDepth(), {_x: 200}); btn2.onPress = function () {     btnPress(); }
sophistikat is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
LoadMovie and turn off buttons below billingsgate Other Flash General Questions 2 07-01-2005 03:58 PM
Buttons Triggered mx.Transitions Scripts jeffrey ActionScript 2.0 1 06-12-2005 10:13 AM
Playing the over state of buttons without rollover drumkeyjw ActionScript 2.0 0 04-20-2005 04:01 PM
Buttons that duplicate MC that can be dragged flashpig ActionScript 1.0 (and below) 5 10-15-2003 12:22 AM

All times are GMT. The time now is 06:47 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.