Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems referencing clip via function.

Status
Not open for further replies.

spook007

Programmer
May 22, 2002
259
US
I have a function that changes the property of various clips. When the function is called reference to the clip is sent. Unfortunately the path I provide does seem to work. I've tried several approaches and was wondering if someone could give me a hand.

I'm calling the function in this manner:
_root.tabs.loadMenu (_root.tabs.tab1.menu1);

This is the function:
function (menu){
setProperty(menu,_x,250);
}

Instead of moving the clip _root.tabs.tab1.menu1 it moves _root.tabs

Thanks in advance.
 
try

_root.tabs.loadMenu (this);

This is the function:
function loadMenu(menu){
trace(menu);
setProperty(menu,_x,250);
}


and see what you have then
 
Hi, I see a problem in the way you wrote your function:

Assuming your function was indeed written on the mainstage. (I msyelf write a lot of my functions in the 1st frame of the mainstage so they can be easily referenced). Try writing it like this:

function changeProperty(menu){
setProperty(menu,_x,250); }


and then to call it:

_root.changeProperty(nameOfTheClip);

I noticed that you didn't give it a name. I'm no expert, but I think that is necessary. Below, you can see that before (menu), there is nothing there.

function (menu){
setProperty(menu,_x,250);

Hope this helps :) !




I want to Learn :D !!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top