Skip to main content
Known Participant
March 10, 2007
Question

named function parameters

  • March 10, 2007
  • 5 replies
  • 335 views
Hi -
I'm trying to condense all the properties of a button or movieclip currently on the stage from:
AnyBtnOrMc._visible=true;
AnyBtnOrMc._x = 400;
AnyBtnOrMc._y = 200;

to:
ElementIs("AnyBtnOrMc", true, 400, 200);

by using the named function attached.

I get the trace(statemnt) but I don't get the mc or btn appearing.

What am I missing?

TIA any help.

JL
This topic has been closed for replies.

5 replies

kglad
Community Expert
Community Expert
March 11, 2007
you're welcome.
JLUCCAuthor
Known Participant
March 11, 2007
Yep - that's the way it's working out.

When one of the inner measurements needs to be blank I've used "0" (without quoutes) and that seems to work.

Hit and miss, hit and miss.

Thanks again for keeping in touch today.

JL
kglad
Community Expert
Community Expert
March 11, 2007
you're welcome.

can you arrange things so only the last parameter is (sometimes) omitted?
JLUCCAuthor
Known Participant
March 11, 2007
kglad -

Thanks again. It works like a charm.

A further clarification please...
As if to prove that a little bit of knowledge can be a dangerous thing...
I've added width and height to the params.
How do I code the ElementIs if I need to leave out one of the params?

JL


kglad
Community Expert
Community Expert
March 10, 2007
your passing a string. you must either pass a reference to the object in your function call or resolve the string to an object in your function (using array notation). which do you want to do?
JLUCCAuthor
Known Participant
March 10, 2007
kglad - What a choice (I understand neither) !
SInce I'm not using any Array I think what I'm looking for is to " pass a reference to the object". By object, you mean "elementName" ?

Thanks for your help.

JL
kglad
Community Expert
Community Expert
March 11, 2007
if you're passing an object reference, don't use quotes: