Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 3rd, 2006, 10:01 AM   #1
john Wesley
Hobbyist Programmer
 
john Wesley's Avatar
 
Join Date: May 2006
Location: United Kingdom
Posts: 119
Rep Power: 3 john Wesley is on a distinguished road
Send a message via MSN to john Wesley Send a message via Yahoo to john Wesley
Flash Buttons Problem

Dont know if there are many Flash developers here but hopefully someone will understand this...

on (rollOver) {
	Home.onRollOver = function() {
		Home._alpha = 0;
		Home1._alpha = 100;
		
	};
}

The button home is 100% visible from the start, and home1 0%. What I want to achieve is; Have these two images change to the opposite on mouse over.

Taking a look at the Flash help it only seemed to show me how to stop, start or loop something on click. I figured this 'should' work' however nothing happens when I preview it. There is also no errors in the script according to the syntax checker.

Thanks for any help.
__________________
Mona Lisa must of had the highway blues you can tell by the way she smiles..
john Wesley is offline   Reply With Quote
Old Sep 3rd, 2006, 12:58 PM   #2
Wizard1988
Professional Programmer
 
Wizard1988's Avatar
 
Join Date: Oct 2005
Location: Chitown
Posts: 417
Rep Power: 3 Wizard1988 is on a distinguished road
Send a message via AIM to Wizard1988
How about checking if they already are 100% and if so then change to 0 and the other way around.
__________________
JG-Webdesign
Wizard1988 is offline   Reply With Quote
Old Sep 3rd, 2006, 1:11 PM   #3
Booooze
Expert Programmer
 
Booooze's Avatar
 
Join Date: Mar 2006
Location: Igloo
Posts: 710
Rep Power: 3 Booooze is on a distinguished road
Send a message via MSN to Booooze
Don't have flash installed right now, but rather than messing with the alphas, why don't you make sure the roll over works. Have it display a message when you rollover each button. Then replace the code with the visibility features. All I can say :p sorry
Booooze is offline   Reply With Quote
Old Sep 3rd, 2006, 10:42 PM   #4
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 419
Rep Power: 4 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
I'm gonna see if I can explain this 'cause I know how to get it to work but bear with me John 'cause Flash is kinda weird to explain (at least to me). The code should actually be this:
on (rollOver) {
	Home._alpha = 0;
	Home1._alpha = 100;
}
Nothing else is really necessary and of course it should be located on the code area for the Home button. However, here's what might be causing the problem. Let's say you drew a rectangle and then converted it to a button and you put as the symbol name Home. That's not the instance name of the rectangle you created. The Home name you gave it represents all copies of that one particular type of button it's sort of like a parent. So what you have to do is actually go into the Properties window and instantiate the rectangle, by giving it an instance name, such as Home_btn (Flash recommends appending buttons with _btn since it helps the popups in the IDE and all that jive). I hope that makes your code work, and of course you should also do this with the Home1 button. Furthermore, the objects will remain that way so you might also want to include an on(rollOut) { } function to reset the alphas to their original state. Good luck.

P.S. If your objects aren't instantiated you're referring to something that doesn't exist, and unfortunately I don't think Flash catches those sorts of errors. The debugging leaves something to be desired.
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis
grimpirate is offline   Reply With Quote
Old Sep 4th, 2006, 4:46 AM   #5
john Wesley
Hobbyist Programmer
 
john Wesley's Avatar
 
Join Date: May 2006
Location: United Kingdom
Posts: 119
Rep Power: 3 john Wesley is on a distinguished road
Send a message via MSN to john Wesley Send a message via Yahoo to john Wesley
Thanks for all your input though I fixed this problem last night. Tomorow I will bring with me the code and show anyone interested, It has been expanded a little...

Funny with programming, everythings the same; but a bit different.
__________________
Mona Lisa must of had the highway blues you can tell by the way she smiles..
john Wesley is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Flash and Java Watts Java 5 Mar 2nd, 2006 11:14 PM
cgi/perl script + IE problem joyceshee Perl 2 Jan 24th, 2006 11:10 AM
XML Integrating With Flash Rizma XML 5 Oct 31st, 2005 11:02 AM
Buttons!! Sane Python 7 Jul 6th, 2005 9:04 PM
Clicking buttons on other Apps Mechromancer C++ 3 Jul 2nd, 2005 11:48 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:00 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC