# XOR equivalent in flash

• yuriythebest
• Banned
• Joined: Feb 24, 2005
• Posts: 143
• Loc: Ukraine
• Status: Offline

March 28th, 2005, 1:01 pm

what's the operator in actionscript that most other prog. langs. call xor - either one or the other, but not both or neither. thanks.
• Anonymous
• Bot
• Joined: 25 Feb 2008
• Posts: ?
• Loc: Ozzuland
• Status: Online

March 28th, 2005, 1:01 pm

• joebert
• Sledgehammer
• Joined: Feb 10, 2004
• Posts: 13458
• Loc: Florida
• Status: Offline

March 28th, 2005, 6:16 pm

Flash has a bitwise xor operator which is the carret ^ , which would be used like so,
Code: [ Select ]
trace((0<1)^(1<2)); //returns 0, both were true
trace((0>1)^(1>2)); //returns 0, both were false
trace((0<1)^(2<1)); //returns 1, first was true but second was false
trace((0>1)^(2>1)); //returns 1, first was false but second was true
1. trace((0<1)^(1<2)); //returns 0, both were true
2. trace((0>1)^(1>2)); //returns 0, both were false
3. trace((0<1)^(2<1)); //returns 1, first was true but second was false
4. trace((0>1)^(2>1)); //returns 1, first was false but second was true
• joebert
• Sledgehammer
• Joined: Feb 10, 2004
• Posts: 13458
• Loc: Florida
• Status: Offline

March 28th, 2005, 6:19 pm

You have to love the example in the reference panel of Flash,
Code: [ Select ]
// 15 decimal = 1111 binary
// 9 decimal = 1001 binary
x = 15 ^ 9
trace(x)
// 1111 ^ 1001 = 0110
// returns 6 decimal( = 0110 binary)
1. // 15 decimal = 1111 binary
2. // 9 decimal = 1001 binary
3. x = 15 ^ 9
4. trace(x)
5. // 1111 ^ 1001 = 0110
6. // returns 6 decimal( = 0110 binary)
Strong with this one, the sudo is.
• yuriythebest
• Banned
• Joined: Feb 24, 2005
• Posts: 143
• Loc: Ukraine
• Status: Offline

March 29th, 2005, 7:50 am

thanks!

## Post Information

• Total Posts in this topic: 4 posts
• Users browsing this forum: No registered users and 32 guests
• You cannot post new topics in this forum
• You cannot reply to topics in this forum
• You cannot edit your posts in this forum
• You cannot delete your posts in this forum
• You cannot post attachments in this forum

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.