A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Link to webpage and cursor change

  1. #1
    Junior Member
    Join Date
    Apr 2010
    Posts
    1

    Link to webpage and cursor change

    Hi,

    I have a flash file and I want to be able to hover over it and see the cursor change and when I click I want to be sent to a page I specify on a website.

    I've tried "on(release) etc" in ActionScript (although I know nothing!) and it says I need to use NavigateToURL so I tried searching on the Internet and couldn't find anything?

    Can anyone please help? I'll happily elaborate if necessary.

  2. #2
    Member
    Join Date
    Feb 2010
    Posts
    59
    There are two things you should know about:

    Mouse.hide();

    AND

    .startDrag(true);

    Mouse.hide() makes the mouse cursor invisible when the movie starts (hide is a method of the Mouse class).

    startDrag() makes whatever you put in front of it the new mouse cursor(startDrag is a method of the movieClip class.

    Example:

    Mouse.hide();

    var newCursor=put the instance name here

    newCursor.startDrag(true);

    true means 'on'
    false means 'off'

    You may be able to use this:

    1)First create a stage EventListener:

    movieClip_name.addEventListener()

    2)Now we want our stage to listen for something namely:

    movieClip_name.addEventListener(MouseEvent.ROLL_OV ER,)

    3) Then we want to trigger a function when the object is rolled over:

    movieClip_name.addEventListener(MouseEvent.ROLL_OV ER, mouseChange)

    4) Now we have to create the mouseChange function:

    function mouseChange(evt:MouseEvent):void
    {
    Mouse.hide();
    newCursor.startDrag(true);
    }

    5)But to make this even better, we can make this work for any object we mouse over:

    function mouseChange(evt:MouseEvent):void
    {
    Mouse.hide();
    evt.target.startDrag(true);
    }

    THE FINISHED SCRIPT:

    movieClip_name.addEventListener(MouseEvent.ROLL_OVER, mouseChange)

    function mouseChange(evt:MouseEvent):void
    {
    Mouse.hide();
    evt.target.startDrag(true);
    }

    So we turned on the 'newCursor' as we drag the mouse over the targeted movieClip, whichever one we mouse over
    Last edited by Suthers; 04-28-2010 at 02:01 PM.

  3. #3
    Member
    Join Date
    Feb 2010
    Posts
    59
    You can try out my Variables&Functions tutorial here:

    http://board.flashkit.com/board/show...56#post4241856

    If you want a better explanation of Functions and Variables.

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