A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: _xmouse for just loaded swf not parent

  1. #1
    Member
    Join Date
    Feb 2005
    Posts
    37

    _xmouse for just loaded swf not parent

    I have a swf file with a loader component which is loading in a SWF. In this SWF I have code to detect _xmouse. The problem is that it is detecting the _xmouse of the main swf file along with the one I loaded in. I am trying to limit the return of _xmouse just for the loaded in swf.

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    specify the target. example:
    this._xmouse or _parent._xmouse

    gparis

  3. #3
    Member
    Join Date
    Feb 2005
    Posts
    37
    I originally gave this. and _parent a try. Both returned the same behavior in that no matter where I move my mouse the _xmouse is still tracking my mouse movement and causing my code to run with in my movie clip.

    Is there a way to make the code inside the swf run only when the mouse is over the loader object? Not really a onRollOver because that will only execute the code once and get one _xmouse position. I need it to constantly run but only when the swf that is loaded into the loader component has a mouse over it.

  4. #4
    Senior Member
    Join Date
    Feb 2001
    Location
    On the fifth floor.
    Posts
    1,202
    1 way: use LocalToGlobal()
    2 way:
    Code:
    mc.onEnterframe = function(){
       if(mc.hitTest(_xmouse,_ymouse)){
           //your action
      }
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center