A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Rotating a object

  1. #1
    Junior Member
    Join Date
    Mar 2007
    Posts
    22

    Rotating a object

    Hello All thank you for your time and assistance
    I am having a problem with a movie I am trying to create ,the movie is a aircaft heading display.This consists of a heading Bug that you select your desired heading and a compass that moves to establish the new heading . I can get the rotation of the heading bug working using( whee_mc is the heading Bug)
    this.onEnterFrame=function(){
    wheel_mc._rotation+=5;

    This action is controlled by a button on press ,on release deletes on enterframe


    I can rotate the compass card with a similar on enter frame function which rotates both the card and the compass,but I cant seem to figure out how to stop when the heading bug is at the top of the compass showing the aircraft is on heading track.
    Sample FLA attached
    Thank you
    Peter
    Attached Files Attached Files

  2. #2
    Member
    Join Date
    Nov 2009
    Location
    Philadelphia
    Posts
    40
    I would like to help you but i just don't understand what you are trying to do... even after viewing the file.
    you have one mc rotating when you click on button and another mc rotating when you click a second button... when should they stop?
    - Nick Stanziani

    pls support: www.whowantsacookie.com

    My site: pebcak

  3. #3
    Junior Member
    Join Date
    Mar 2007
    Posts
    22
    Dear Nick
    Thank you very much for your reply.
    The movie clip needs to work as follows.
    You select a heading from 0-360 deg on the heading bug then engage the heading (withe top button) , action is the compass card and and the heading bug rotate in the reverse direction and stop when the selected heading bug is back at O deg position , this shows that the aircraft is flying at the selected heading bug position. once the heading mode is turned on any heading changes cause the cardr and heading bug to rotate until the heading bug and the compass card show the correct heading.

    Also at the top which I haven't quite worked out yet the actual heading of compass card updates to show the selected heading which will update as the heading bug re_centers itself.I( can do it with a simple tween of 360 frames but not sure how to do it with action script as once your rotation exceeds 180 the rotation shows a negative number).
    The positioning of the bug needs to travel both counter clockwise and clockwise I have only shown clockwise in my movie.

    So how it works in real life the pilot selects a heading using the heading bug ,engages the Heading control, the aircraft then flies to the selected heading,he then moves the heading bug and the aircraft corresponds to any bug changes.Hope this helps .I am an aircraft engineer sorry ,if at first I did not explain myself fully.


    Just one thought regarding forums in general has anyone thought of setting up a paid forum /help line where you could pay a certain amount of money for tickets to be traded for help ,each submission would then be assessed by the moderators as to how many tickets the solution is worth ,then the person who the provides the answer would be paid a percentage of the ticket price the rest going towards the administration of the site.Check and balances could be put in so that system was not abused .The main thing the answer would be available to paying members only .The payment could be say a monthly payment providing you with x amount of tickets accumulative each month ,and then the ability to purchase more tickets as and when required.
    Best Regards Peter

  4. #4
    Member
    Join Date
    Nov 2009
    Location
    Philadelphia
    Posts
    40
    Can't be done using tweens... you havd to use code...
    I've uploaded an example to my site
    my website
    you can also download the fla file from there...
    it's the last example on the main page...
    - Nick Stanziani

    pls support: www.whowantsacookie.com

    My site: pebcak

  5. #5
    Junior Member
    Join Date
    Mar 2007
    Posts
    22
    Dear Nick
    Thank you very much for your help just what I needed ,I tried to load the FLA but all I got was a page of Symbols like.
    ÐÏ*¡±á����������������>��þÿ ��������������������������~������þÿÿÿ���� ���€���ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿR�o�o�t� �E�n�t�r�y���������������������������������������� �������ÿÿÿÿÿÿÿÿ���pª|YªrσRASH���� ����������)ŸˆÊ���@(������C�o�n�t�e�n�t�s�� ������������������������������������������������ ÿÿÿÿ���ÿÿÿÿ����������������������������� �������•���S������P� �1�
    This not sure what to do .
    Best Regards Peter

  6. #6
    Member
    Join Date
    Nov 2009
    Location
    Philadelphia
    Posts
    40
    it's a Flash CS3 file. If you don't have CS3 you may be out of luck. What version are you running?
    - Nick Stanziani

    pls support: www.whowantsacookie.com

    My site: pebcak

  7. #7
    Junior Member
    Join Date
    Mar 2007
    Posts
    22
    Dear Nick
    I have both but I use Flash 8 because of problems of using Flash CS3 in Adobe Director ,is the file straight action script code or a full FLA file all I get is text when I link to it no download of a FLA.
    Thanks for your Help
    Peter

  8. #8
    Member
    Join Date
    Nov 2009
    Location
    Philadelphia
    Posts
    40
    i've attached it to this reply. It is a regular CS3 FLA file. Nothing special.
    Attached Files Attached Files
    - Nick Stanziani

    pls support: www.whowantsacookie.com

    My site: pebcak

  9. #9
    Junior Member
    Join Date
    Mar 2007
    Posts
    22
    Thanks nick for your help
    Reg Peter

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