-
[RESOLVED] Passing an instance name argument into a function
Hi guys, I'm kind of new to actionscript. I searched the forum and couldn't find anything on this and searched google as well and could not find an answer soo this is my first post here hope you can guys can help.
Well I want to set up a function that will calculate the x position of where my MovieClip's instance name will go.
Here is the code i currently have.
function xBtnPosition(btnName: String, btnXpercentage: Number):String
{
var xFinalPosition: String = -(((btnName.width * btnXpercentage) / btnName.scaleY));
return (xFinalPosition);
}
var storedResult: String = xBtnPosition(navigationbg_mc, .85);
As you can see I pass the two arguments into my function but it says there is an error because it's a string, how do I make it so it's not a string and it can be used in the function? Help would be greatly appreciated! Thanks guy!
-
function xBtnPosition(btnName: DisplayObject, btnXpercentage: Number):String
-
Wow! Thanks beathoven! So I take it you are an actionscript 3 genius? lol. Been around since 2002, you got a website I can visit?
-
Originally Posted by arod87
Wow! Thanks beathoven! So I take it you are an actionscript 3 genius? lol. Been around since 2002, you got a website I can visit?
I am actually not no. I just started coding again. Just happened to come here around 2002 looking for help in AS2. Didn't make websites for a couple years then started again a year ago.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|