Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: RE: FLASH: Calling a function from an instance to change its position
From: Paul Steven
Date: Sat, 23 Sep 2000 00:15:47 +0100

Thanks for everyone who replied

I have found the solution thanks to heyotwell on Flashkit forum

He said:

If you're passing the name of the Baddie using the _name property, you're
getting a string as the first argument to the function, which isn't going to
work: when you hit the line

passed_Object_Name._x=passed_Object_Name._x+passed_Speed

you end up with something like

"Baddie1"._x = "Baddie1"_x + xxx

which doesn't look right, no?

Try passing the objects "this" to it instead, so:

Move_Object(this, "Right", 5) The "this" is a reference to the object which
is _not_ a string.





-----Original Message-----
From: owneratchinwag [dot] com [owneratchinwag [dot] com]On">mailto:owneratchinwag [dot] com]On Behalf Of Not In My
Backyard!
Sent: Friday, September 22, 2000 11:54 PM
To: flasheratchinwag [dot] com
Subject: Re: FLASH: Calling a function from an instance to change its
position


Have you tried:

_root[passed_Object_Name]._x += passed_Speed




>Hi there
>
>I have created a generic function taht when called should move an object
>
>///////////////////////////////////////////////////////////////////////
>// Function to move an object in a certain direction at a certain speed
>///////////////////////////////////////////////////////////////////////
>
> function Move_Object (passed_Object_Name, passed_Direction,
>passed_Speed) {
>
> if (passed_Direction=="Right") {
>
> passed_Object_Name._x=passed_Object_Name._x+passed_Speed;
>
> }
>
> } // End of function
>
>I have used trace to check the values of the parameters being passed and
>they are all as expected.
>Now I have a baddie whose instance is called "Baddie1" that calls this
>function passing the values of the three parameters. However it is not
>changing the x position of the Baddie.
>
>If I replace the line
>
>passed_Object_Name._x=passed_Object_Name._x+passed_Speed;
>
>with
>
>Baddie1._x=Baddie1._x+passed_Speed;
>
>it works.
>
>However this is unacceptable because I want to use this function to move
>several different characters.
>
>Can anyone see why it is not working - I have checked the value of
>passed_Object_Name and it is correct
>i.e Baddie1
>
>Thanks
>
>Paul
>
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>NudeGuru.com is proud to sponsor the Flasher list
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> IT'S THE ART OF MONEY, HONEY!
> Tips and Advice from some of the most popular Flash
> artists + industry power-brokers on how to hold onto
> your rights, negotiate contracts and get full value
> for your work.http://www.nudeguru.com from Franke James
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>To unsubscribe or change your list settings go to
>http://www.chinwag.com/flasher or email helpatchinwag [dot] com


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NudeGuru.com is proud to sponsor the Flasher list
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IT'S THE ART OF MONEY, HONEY!
Tips and Advice from some of the most popular Flash
artists + industry power-brokers on how to hold onto
your rights, negotiate contracts and get full value
for your work.http://www.nudeguru.com from Franke James
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NudeGuru.com is proud to sponsor the Flasher list
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IT'S THE ART OF MONEY, HONEY!
Tips and Advice from some of the most popular Flash
artists + industry power-brokers on how to hold onto
your rights, negotiate contracts and get full value
for your work.http://www.nudeguru.com from Franke James
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  Re: FLASH: Calling a function from an in, Not In My Backyard!

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]