Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 8th, 2003, 11:48 AM
z00m z00m is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 102 z00m User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
small change in question :)

hmmmm how can i do for example
if ("object._alpha == 80) {
"some action"

on a frame other than the frame containing the "object"?

thanks, z00m

Last edited by z00m : December 8th, 2003 at 05:48 PM.

Reply With Quote
  #2  
Old December 8th, 2003, 02:44 PM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,714 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 10093 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 11 h 8 m 12 sec
Reputation Power: 580
Facebook MySpace
Hi, are you sure your setting the button alpha correctly? I made what you said and it works for me. To test it I made the button alpha change from 80 to 100 each time the button itself is clicked i.e:

on (release) {
if (_alpha == 100) {
_alpha = 80;
} else {
_alpha = 100;
}
}

and used the code you provided (minus the last closing brace):

if (_root.button._alpha == 80) {
textname.text = "something here";
} else {
textname.text = "something else writen here";
}
stop();

I added a stop command for my clip, maybe you dont need it. Have you double checked that you have actually called the button instance "button"? Know it's silly but you never know.
__________________
-Tann

-Vote for your favorite ActionScript editor here.

Reply With Quote
  #3  
Old December 8th, 2003, 02:52 PM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,714 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 10093 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 11 h 8 m 12 sec
Reputation Power: 580
Facebook MySpace
hi, sorry my bad, doesnt work forgot to test the text bit out. working on it now

Reply With Quote
  #4  
Old December 8th, 2003, 03:41 PM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,714 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 10093 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 11 h 8 m 12 sec
Reputation Power: 580
Facebook MySpace
Here you go, I attached a demo clip. wowza that took me a while for no real reason!?

Break down of code is:

on (release) {
if (_root.thatbutton._alpha == 100) {
_root.thatbutton._alpha = 80;
} else {
_root.thatbutton._alpha = 100;
}
}

Added the code to change button alpha to the actual button, not sure how you do it but this worked for me. Had to set it by name as just _alpha set it for the whole clip (cept the text but thats normal with dyna text).

trace(thatbutton._alpha);
if (_root.thatbutton._alpha > 80) {
textname.text = "more than 80";
} else {
textname.text = "less than or equal to 80";
}

This is in the first keyframe, i used two kf's in the clip. I used trace to show you what is happening. Flash doesnt always stick to the number you specify. Run the demo in flash to see what I mean, even the though I statically set the button to 80 the trace shows its alpha as 79.846whatever... By altering the if statement this is accounted for.
Attached Files
File Type: zip buttonalphatext.zip (5.0 KB, 265 views)

Reply With Quote
  #5  
Old December 8th, 2003, 04:31 PM
z00m z00m is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 102 z00m User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
wow this forum rox thank you very very much m8!

Reply With Quote
  #6  
Old December 8th, 2003, 04:51 PM
z00m z00m is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 102 z00m User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
bah well my mistake :(

it still doesn't work...
i misexplained my self.

i have 1 frame with 2 buttons
one changes from _alpha 50 to alpha _100 and versa every time u click it
the other button goes to frame 2, in frame 2 i have the action i've posted up there
i want it to know when on frame 1 the button's alpha is what i've changed it too :\ if u can still help me so thanks again

now i see the problem for sure is that the buttons are on a different frame, n e way to get over it?

Last edited by z00m : December 8th, 2003 at 05:04 PM.

Reply With Quote
  #7  
Old December 8th, 2003, 06:50 PM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,714 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 10093 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 11 h 8 m 12 sec
Reputation Power: 580
Facebook MySpace
Hi, ok I modified the demo. Maybe that will be what your looking for. You've got to have the buttons instantiated when you try to read their properties, you may be trying to do the following which wont work:

you have both buttons in keyframe 1. You have no frames with the buttons after that. On a new layer (or the same layer but with a keyframe not including the buttons) in keyframe 2 you have the if statement you wrote. That wont work.

You must have either a keyframe or a frame with the buttons on at the same point as you call the code, in this case the if statement.

Maybe I'm wrong on this one, see what other people say. You could do this other ways without having to have the buttons around but you wouldnt be able to directly check their current status because they dont exist. You could get the buttons to set a variable when clicked that indicates their alpha. Then read that instead. dont see why but everyone has their reasons, right?

Sorry if thats kind of rambling, im tired now.

good luck
Attached Files
File Type: zip buttonalphatextv2.zip (4.6 KB, 231 views)

Reply With Quote
  #8  
Old December 9th, 2003, 12:45 AM
z00m z00m is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 102 z00m User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
i am sitting here stunned from your guys replys....
u take the time to write me a huge answer...
thank you very very much m8!

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > different actions with the same "button"


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT