-
[RESOLVED]Putting two variables together - How?
Hey all, these forums are really good, so I'm back for more!
Basically, what I want to do is in the title.
I need to put two variables together, amongst other things to create one big variable that combines the lot.
This is what I'm working with:
Code:
circle.graphics.lineStyle (3, 0xFF0000|(circlenum*20 <<64);
This is just an example, the parameters, and names are made up. It's the color that I want to put together.
-0xFF0000 is "Var1"
-64 is "Var2"
Simply, I need to be able to do it liek this;
Var1|(circlenum*20 <<Var2
Anyone tell me how this is done?
Thanks in advance!
Last edited by raven3962; 02-09-2008 at 06:59 AM.
Reason: Resolved
-
I've just figured it out, I'll put it here so others can see it:
First, the variables are made further up the script.
Var1 = 0xFF0000
Var2= 64
basically, this is the code:
Code:
circle.graphics.lineStyle (3, Var1| (circlenum*20 <<Var2);
Makes: (that flash sees it as)
circle.graphics.lineStyle (3, 0xFF0000| (circlenum*20 <<64);
I hope this helps someone out.
Thanks!
-
Bearded (M|G)od
So wait. You were working with bit shifting and the drawing API, but didn't know how basic variables worked?
What kind of a background do you come from?!
-
trace("AKA: Biro Barna");
Originally Posted by MyFriendIsATaco
So wait. You were working with bit shifting and the drawing API, but didn't know how basic variables worked?
What kind of a background do you come from?!
Hah, welcome to the forum... Just open your eyes a bit more and you'll see that 70% of the people posting a problem are trying to do a really complex application but they have no idea what a variable is or how an "if" statement works... I know, it's funny...
| Windows MSN: birobarna [at] hotmail [dot] com | Skype: barna.biro | WebLog: http://blog.wisebisoft.com/ |
| Software Developer / Flash & Flex Developer | Student ( Computer Science ) | Interested in: Sharing Knowledge |
| Romanian Adobe Flash, Flex, AIR Forum: http://www.flashforum.ro/ | By perseverance the snail reached the ark. |
-
Uh... What does shoving a variable 64 bits up a 32 bit ARGB do?
The greatest pleasure in life is doing what people say you cannot do.
- Walter Bagehot
The height of cleverness is to be able to conceal it.
- Francois de La Rochefoucauld
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|