Welcome to Dream.In.Code
Getting Help is Easy!

Join 107,420 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,167 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Easy Action Script Question

 
Reply to this topicStart new topic

Easy Action Script Question

darkfluffy
post 23 Jun, 2008 - 10:17 PM
Post #1


New D.I.C Head

*
Joined: 23 Jun, 2008
Posts: 2

Hi, this is a relatively easy question. Im not to advanced in action script, and I know that their is a way to my obstacle.

CODE
        if (_root.r4 == 55) {
            Function();
        }


This is my basic code Im using.

I was wondering how you would use "OR".


Like this:

CODE
        if (_root.r4 == 55 OR 57 OR 59 OR 61 OR 65) {
            Function();
        }


I just cant figure it out, some help would be nice. smile.gif

Thank you!
User is offlineProfile CardPM

Go to the top of the page


BetaWar
post 23 Jun, 2008 - 11:38 PM
Post #2


#include <soul.h>

Group Icon
Joined: 7 Sep, 2006
Posts: 1,107



Thanked 37 times

Dream Kudos: 675
My Contributions


Sadly AS doesn't support using or in that manner, it will have to be like so:

CODE
if (_root.r4 == 55 || _root.r4 == 57 || _root.r4 == 59 || _root.r4 == 61 || _root.r4 == 65) {
            Function();
        }


It isn't beautiful, but it works smile.gif
User is online!Profile CardPM

Go to the top of the page

darkfluffy
post 24 Jun, 2008 - 09:55 AM
Post #3


New D.I.C Head

*
Joined: 23 Jun, 2008
Posts: 2

QUOTE(BetaWar @ 23 Jun, 2008 - 11:38 PM) *

Sadly AS doesn't support using or in that manner, it will have to be like so:

CODE
if (_root.r4 == 55 || _root.r4 == 57 || _root.r4 == 59 || _root.r4 == 61 || _root.r4 == 65) {
            Function();
        }


It isn't beautiful, but it works smile.gif



THANK YOU! smile.gif
User is offlineProfile CardPM

Go to the top of the page

BetaWar
post 24 Jun, 2008 - 11:06 PM
Post #4


#include <soul.h>

Group Icon
Joined: 7 Sep, 2006
Posts: 1,107



Thanked 37 times

Dream Kudos: 675
My Contributions


No problem.
User is online!Profile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 8/28/08 08:22PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month