Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Actionscript / July 2008



Tip: Looking for answers? Try searching our database.

Return Movie Clip instance name onRollOver

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lynoon - 04 Jul 2008 03:46 GMT
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();
}
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.