PDA

View Full Version : : or .


philspeakman
02-22-2002, 09:29 AM
what does : mean as apposed to .

sfa
02-22-2002, 09:45 AM
the first has two dots and the second has one :D

SFA

sfa
02-22-2002, 09:52 AM
excuse my stupid joke. As far as i know, and this is the way i write my actionscript I only use the ":" as a conditional operator.
Ex.

SFA_said_stupid_joke ? slap_him : pat_him;

this meansthat if the first operand (SFA_said_stupid_joke) is true assign the value second operand to it(slap_him), if it is false assign the third (pat_him)

The "." on the other hand is used to set paths. If you write _root.actionscript_org.SFA it means that SFA is in actionscript_org that is in _root

Hope that explains it all and again, sorry for the sick joke, i was bad, bad, bad

SFA

pinkaboo
02-22-2002, 09:54 AM
I think that the : indicates that the whatever is after it is a variable.

so

_root.mc:variable

breaks up into 2 parts, the path, and then the variable (ie frame label)

maybe useful link to Macromedia? (http://www.macromedia.com/support/flash/ts/documents/flash_labels_scripting.htm)

K

pinkaboo
02-22-2002, 09:57 AM
bah humbug, sfa got there first, naughty sfa!
bad bad jokes and sneaky with it too!

K

philspeakman
02-22-2002, 10:58 AM
Thanks k and sfa
very helpful and the joke if you can call it that did make me smile.
Take it easy.

jimburton
02-22-2002, 11:14 AM
when used as an access operator (to get at variables or clips etc), as opposed to sfa's example of the shortcut conditional, : is flash4 syntax - don't use it unless that's what the movie will be exported as.

philspeakman
02-23-2002, 11:00 PM
Nice one - i hope i don't have to think about that, its complicated this flash lark..