Hi All,
Sorry if this is a stupid questions but I am relatively new to actionscript.
I have a movie clip on the main timeline that contains a large number of clips
that I am storing different pieces of information against.
I want to dynamically return the movie clip instance names of the clips in the
container with a rollover function so I can pass the instance name into custom
class.
I am wanting to use a function that will treat the returned instance name as a
variable that I can pass into the custom class as to avoid having to code the
class function against each individual movie clip.
Is this possible as I have been searching for ages and have not found anything
that accomplishes this.
Many thanks in advance
kglad - 04 Jul 2008 06:28 GMT
use "this" without quotes in your rollover handler to reference the object undergoing the rollover.
Lynoon - 04 Jul 2008 11:43 GMT
Thanks for the reply.
Do I have to place this code on the instance for this to work. It did not
recognise "this" on the main timeline.
The deskContainer_mc contains the movie clip instances. Each instance in the
container is named with the following convention D####_mc.
If I replace the D9300_mc with "this" it throws an error.
Any thoughts?
Thanks again and please excuse my inefficient code...
import EmployeeInfo
var EmployeeData:EmployeeInfo = new EmployeeInfo(deskContainer_mc.D9300_mc,
deskContainer_mc.D9300_mc.deskCover_mc, deskInfo_mc);
deskContainer_mc.D9300_mc.onRollOver = function() {
EmployeeData.loadXMLData();
}
deskContainer_mc.D9300_mc.onRelease = function() {
EmployeeData.returnXMLData();
}
Karl - 04 Jul 2008 07:30 GMT
> Hi All,
>
[quoted text clipped - 12 lines]
>
> Many thanks in advance
You'll want to make a global var like this _global.aa
You'll want to make a global array actly.
It should work if you put in the code in the imbedded clip
<instancename>.onRollOver = function() {
myarray[i] = instancename <<<<actually eval(instancename);
i++
}
Do this for each instance, if that doesn't work let me know
kglad - 04 Jul 2008 16:50 GMT
"this" is understood everywhere, including the main timeline:
for your buttons try:
deskContainer_mc.D9300_mc.onRelease= function() {
Class1.staticF(this);
EmployeeData.returnXMLData();
}