Home Tutorials Forums Articles Blogs Movies Library Employment Press

 ActionScript.org Forums finding multiple of a number
 User Name Remember Me? Password
 Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

 Thread Tools Rating: Display Modes
 07-11-2008, 09:45 PM #1 pelachrum mighty mouse   Join Date: Oct 2002 Location: New York City Posts: 291 finding multiple of a number how would you write in actionscript what in plain English sounds like: if i equals 7 or a multiple of 7 ActionScript Code: `if (i==7 || ??????)` to state that in a literal (although limiting) form it would look like this ActionScript Code: `if (i==7 || i==14 || i==21 || i==28)`
 07-11-2008, 10:23 PM #2 eddiewireless Chicken and perks!     Join Date: Jan 2007 Location: Earth Posts: 529 that sounds a lil tricky, how far up do you wanna go? I guess you could use a loop to calculate the next multiple but you need to eventually stop it or your script will malfunction. (Infinite Loop)
 07-11-2008, 11:05 PM #3 pelachrum mighty mouse   Join Date: Oct 2002 Location: New York City Posts: 291 ok let's keep it realistic then up to 5
 07-11-2008, 11:54 PM #4 daveystew Dave Stewart     Join Date: Aug 2005 Location: London Posts: 777 The operator (%) is built into most languages, and is called modulo: var num = 235 var multiple = 5 var isMultiple:Boolean = num % multiple == 0 __________________ xJSFL | Creative | Technical

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 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 Off HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home ActionScript Forums Group     ActionScript 3.0     ActionScript 2.0     ActionScript 1.0 (and below)     Simple Stuff (Newbies) Flash General Questions     Flash 10 General Questions     Flash 9 General Questions     Flash 8 General Questions     Other Flash General Questions Flex     Flex 2, 3 & 4     Flex 1 Extensions and Plugins     Components     JSFL - Extending Flash Desktop, Mobile and non-browser Environments     AIR (Apollo)     FlashLite / Portable Devices Development     Projectors and CDs Supporting Technologies     HTML and JavaScript     haXe     Server-Side Scripting     Flash Remoting     Flash Media Server General     Best Practices     Gaming and Game Development     Animation and Effects     Flashants Support Forum Community Boards     General Chat     Just for Kicks Challenges     Detention Flash In Action     Site Check     Cool Sites     Widgets Decommissioned     Projects and Positions CMS Forums     Announcements Board     Content Postings / Updates     Product Review Requests     CMS Technical Questions     Process Questions     Collaboration & Suggested Articles

 Similar Threads Thread Thread Starter Forum Replies Last Post doobie ActionScript 1.0 (and below) 7 04-28-2007 01:47 AM Mutty Other Flash General Questions 15 10-09-2006 03:16 PM bltrio ActionScript 2.0 2 04-24-2006 12:05 AM maglez ActionScript 2.0 2 06-02-2005 05:14 PM Rush152 Simple Stuff (Newbies) 2 01-25-2004 12:10 AM

All times are GMT. The time now is 08:16 PM.

///

## Categories

 Contact Us - Home Page - Archive - Privacy Statement - Top

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.