Point Seclusion
Friday March 29, 2024, 12:00:21 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome Member
 
  Home Help Search Arcade Gallery Links Staff List Calendar Members Login Register  

programming quiz time!

Pages: [1]   Go Down
  Print  
Author Topic: programming quiz time!  (Read 470 times)
0 Members and 1 Guest are viewing this topic.
raider00321
Moderator
King
*****
Offline Offline

Newgrounds Alias: raider00321
Posts: 969


Mood:Not a happy chappy


View Profile
« 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! Wink
Report Spam   Report to moderator   Logged

V BEST FREE WEBHOST FOUND BY FAR V http://www.000webhost.com/89919.html

Share on Facebook Share on Twitter

§ Skylinegodzilla ♪
Speedy Sky Mod
Moderator
King
*****
Offline Offline

Newgrounds Alias: skylinegodzilla
Posts: 1043


The Sky is the limit


View Profile WWW
« 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?
Report Spam   Report to moderator   Logged

himm... i seam to mist place my signature
§ Skylinegodzilla ♪
Speedy Sky Mod
Moderator
King
*****
Offline Offline

Newgrounds Alias: skylinegodzilla
Posts: 1043


The Sky is the limit


View Profile WWW
« 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?
Report Spam   Report to moderator   Logged

himm... i seam to mist place my signature
raider00321
Moderator
King
*****
Offline Offline

Newgrounds Alias: raider00321
Posts: 969


Mood:Not a happy chappy


View Profile
« 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
Report Spam   Report to moderator   Logged

V BEST FREE WEBHOST FOUND BY FAR V http://www.000webhost.com/89919.html
§ Skylinegodzilla ♪
Speedy Sky Mod
Moderator
King
*****
Offline Offline

Newgrounds Alias: skylinegodzilla
Posts: 1043


The Sky is the limit


View Profile WWW
« Reply #4 on: Friday October 17, 2008, 12:08:43 am »

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! Wink

did you for get to ad the new value to the _X?

Smiley.[/glow][/shadow][/color][/u][/i][/b]
Report Spam   Report to moderator   Logged

himm... i seam to mist place my signature
raider00321
Moderator
King
*****
Offline Offline

Newgrounds Alias: raider00321
Posts: 969


Mood:Not a happy chappy


View Profile
« 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
Report Spam   Report to moderator   Logged

V BEST FREE WEBHOST FOUND BY FAR V http://www.000webhost.com/89919.html
raider00321
Moderator
King
*****
Offline Offline

Newgrounds Alias: raider00321
Posts: 969


Mood:Not a happy chappy


View Profile
« 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).
Report Spam   Report to moderator   Logged

V BEST FREE WEBHOST FOUND BY FAR V http://www.000webhost.com/89919.html
Turn-Coat
Newbie
*
Offline Offline

Posts: 3


View Profile
« 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();
Report Spam   Report to moderator   Logged


Pages: [1]   Go Up
  Print  
 
Jump to:  

Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy