dcsimg
A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Is it possible to keep the orientation of an image inside a symbol?

  1. #1
    Junior Member
    Join Date
    Jun 2015
    Posts
    4

    Is it possible to keep the orientation of an image inside a symbol?

    I'm working on a compass and I would like the arrow to behave as if it was magnetized and always point to the top (North) of the page regardless of where the symbol it's in is dragged on the stage. The dial is tagged with a mouse_wheel event and the whole compass is tagged with a rotation triggered by a mouse click event, but at the moment the needle rotates with the dial symbol instead of simulating it's attraction to the magnetic north. Is it possible to add a hot spot in a image and anchor it to a xy point way off the top of the stage?

    Any ideas?

    Thanks

    Dan

  2. #2
    Senior Member
    Join Date
    Aug 2012
    Posts
    124
    Yes is possible,

    you have file to seing

  3. #3
    Senior Member
    Join Date
    Feb 2005
    Posts
    1,811
    When rotating the compass you just need to rotate the needle in the opposite direction by the same amount.
    To point it to an anchor point, something like this: http://stackoverflow.com/questions/7...orizontal-axis
    .

  4. #4
    Junior Member
    Join Date
    Jun 2015
    Posts
    4
    I dont have public hosting, but I will try to think of something to display the compass.

    Thanks SWAK, I didn't think of going opposite for the needle, however the other problem Im having using the mouseWHEEL event is that the rotation is only in one direction, is there a code snippet that would tell an object to rotate in the opposite direction?

    Thanks

  5. #5
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    HI,

    Do you mean anything like this?

  6. #6
    Junior Member
    Join Date
    Jun 2015
    Posts
    4
    that's exactly what I mean, I'm attaching mine.

    I had to remove the map to reduce the file size for the forum, so all I need to do now is apply your AS3 to my compass, your scripting is very nice, a little out of my league at the moment, but very elegant.

    Thanks and have a very nice day!
    Attached Files Attached Files
    Last edited by DLNDan; 06-16-2015 at 12:28 PM.

  7. #7
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi,

    This is the best I can do with your graphics.

  8. #8
    Junior Member
    Join Date
    Jun 2015
    Posts
    4

    Muchos Gratzias

    Thanks, I was also trying your script out on my own and got it to work the way I want it to, I cant thank you enough, I tried paypal to give you a little something, but I was unable to complete the transaction, the province (Ontario/Canada) field wouldn't show up, so I couldnt submit, I will try again later at home.

    Your time is greatly appreciated.

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