Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > Adobe Web Programming > Flash (all versions)
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Flash (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 4th, 2009, 04:25 AM
Registered User
Join Date: Aug 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to make one object disapire and new one came up

Hello,im working on some project and i cant figure how to make when i click on one button to make one object on screen disapire and new one came on his place....When my site open there is a welcome not i wont when i click on "about us" button to welcome note disapire and "about us" note came insted:)

Old August 10th, 2009, 06:46 AM
Authorized User
Join Date: Aug 2009
Posts: 18
Thanks: 2
Thanked 0 Times in 0 Posts

You could add some action script on button. Give those objects a name, i mean instance name and in button behaviours (those four states - Up, down...) add code.
Take look at some of this tutorials: http://www.kirupa.com/developer/flash/index.htm
Code should be like this:
Object1 and 2 are those "about us" and "Welcome" notes.
p.s. first you have to create instances of your objects.

Last edited by Lupus81; August 10th, 2009 at 06:49 AM..
Old August 10th, 2009, 09:03 AM
Registered User
Join Date: Aug 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

tnx i will try
Old August 10th, 2009, 09:27 PM
Friend of Wrox
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts

Originally Posted by mitjko View Post
tnx i will try
You can also handle this via animation.

1. Create a keyframe with your initial state
2. Create a second keyframe with your final state
3. use actionscript to stop the second keyframe, ie: stop();
4. use actionscript to program the button on the keyframe with the initial state. If the second keyframe is on frame 3, then...

on (release) {

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
Old August 11th, 2009, 02:13 AM
Registered User
Join Date: Aug 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

tnx!!it hellped

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chap 13 pg448: Object reference not set to an instance of an object tomche BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 15 August 8th, 2009 06:14 AM
how to make an object draggable? catchrohith Classic ASP Basics 2 July 9th, 2007 12:27 PM
make object floatable catchrohith Classic ASP Basics 0 November 18th, 2006 01:17 AM
create a Line object ,Box object in CR at Runtime? thanhnt Pro VB 6 1 May 16th, 2005 06:51 AM
Beg --Object required: '' ? what error did i make? kecik101 Classic ASP Databases 3 April 28th, 2004 09:19 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.