raider00321
Moderator
King
Offline
Newgrounds Alias: raider00321
Posts: 969
Mood:Not a happy chappy
|
|
« on: Thursday October 16, 2008, 08:29:52 pm » |
|
ok ya'll i have a quiz for all of you who are gonna try to get it -.- A variable with a value has been declared with a value to give a position of an object on the x-scale. The problem is when used to position this object, the object apears at position 0 on the x plane. When this specific value is traced, it does give a numeric value. What is the problem and how do you fix it? For further information, i did run into this problem so it can happen, and yes i fixed it so there is a viable solution. Cookies to whoever figures it out!
|
|
|
|
|
§ Skylinegodzilla ♪
Speedy Sky Mod
Moderator
King
Offline
Newgrounds Alias: skylinegodzilla
Posts: 1043
The Sky is the limit
|
|
« Reply #1 on: Thursday October 16, 2008, 10:41:56 pm » |
|
i would try to but i am still trying to figer out what trace is and what is the diference between _x and xscale? and i take it when you say x plane you mean _x?
|
himm... i seam to mist place my signature
|
|
|
§ Skylinegodzilla ♪
Speedy Sky Mod
Moderator
King
Offline
Newgrounds Alias: skylinegodzilla
Posts: 1043
The Sky is the limit
|
|
« Reply #2 on: Thursday October 16, 2008, 11:41:27 pm » |
|
mk trace just [rints out the value of a variable. when i said xscale, that was wrong, i meant the x plane. and when i say xplane, it is _x
mk trace just [rints out the value of a variable? o and what is x scale?
|
himm... i seam to mist place my signature
|
|
|
raider00321
Moderator
King
Offline
Newgrounds Alias: raider00321
Posts: 969
Mood:Not a happy chappy
|
|
« Reply #3 on: Thursday October 16, 2008, 11:57:13 pm » |
|
soy, not rints, prints lol. or should i say, displays the value of the variable. Also Xscale is some thing different in flash cmpared to the context im using it to. what i mean by xscale is x position. lol my bad
|
|
|
|
§ Skylinegodzilla ♪
Speedy Sky Mod
Moderator
King
Offline
Newgrounds Alias: skylinegodzilla
Posts: 1043
The Sky is the limit
|
|
« Reply #4 on: Friday October 17, 2008, 12:08:43 am » |
|
[/glow][/shadow][/color][/u][/i][/b]
|
himm... i seam to mist place my signature
|
|
|
raider00321
Moderator
King
Offline
Newgrounds Alias: raider00321
Posts: 969
Mood:Not a happy chappy
|
|
« Reply #5 on: Friday October 17, 2008, 01:53:48 am » |
|
the variables value was checked, and it was correct.
You'll never get it -.- lol
|
|
|
|
raider00321
Moderator
King
Offline
Newgrounds Alias: raider00321
Posts: 969
Mood:Not a happy chappy
|
|
« Reply #6 on: Friday October 17, 2008, 07:21:07 pm » |
|
mk times up! the problem is that the value was somehow stored as a string type variable. to fix this problem in flash, we simply need to cast the data back into a string by doing this....
value = int(value);
Stay tuned for more quizes for those that participated this round and those interested aswell(currently only one person it seems XD).
|
|
|
|
Turn-Coat
|
|
« Reply #7 on: Friday September 10, 2010, 04:39:04 am » |
|
Thats why you always tell flash what kind of a variable it is when you instantiate it.
var kuf:Number=0;
var stats:Object={}
var array:Array=[]
and so on and so forth.
In classes instead of instantiating a bunch of variables, I just use one:
var stats:Object={}
then when I need to use a ton of variable in my functions I reference the stats Object and create a variable right then and there: stats.x=67; stats.y=5; and when you want a number to be a string you either put it in quotations, or use stats.x.tostring();
|
|
|
|
|
|