0

Good morning everyone, how are you?   Onve again I am here sharing my questions and learning more and more with you. I hope that somehow we can exchange information and expand our knowledge.   Guys, I'm using a class very interesting I found on the internet for creating Scrollers (I have difficulties creating them). However, I have the need to load a swf that contains an movieclip object scroller inside. When I do this, the scroller stops working because it no longer has the object reference stage that uses MouseEvent.MOUSE_WHEEL.   Could anyone give me any tips on how to use these listener without the stage reference?   Regards,

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
rennanreis
  • 41
  • 1
  • 5
  • check that another object don't cover object, which has MOUSE_WHEEL listener. – dimpiax May 13 '13 at 11:35
  • Is this an AIR app on Windows? Flash scrolling with the scroll wheel is a known issue in Windows AIR apps. It is not nearly sensitive enough when compared to the rest of the system or even normal SWFs. You may need to increase sensitivity in the event handler. – Josh May 13 '13 at 16:10
  • Its a shockwave app, but I´m newbie at loading external content form a server. Stalem helped me with the post below. I don´t even know how to work with AIR Apps. Thank you for your advice. – rennanreis May 13 '13 at 18:06

1 Answers1

0

You could create a function in the SWF that you're loading, to set a stage reference. Something like

public function setStage ( s:Stage ) : void
{
    _stageReference = s;
    // Add scroll listeners here
}

And then, when the SWF has been loaded into your main SWF, you could do this (assuming that the main class of your loaded SWF is named MainLoaded of course)

private function onLoaded ( e:Event ) : void
{
    var target:MainLoaded = e.currentTarget.loader.content as MainLoaded;
    target.setStage( stage );

    addChild(target);
}
stalem
  • 219
  • 1
  • 13
  • Glad to hear! And if it's working you should mark it as an answer to your question for others to see :) – stalem May 16 '13 at 10:41