dcsimg
A Flash Developer Resource Site

Results 1 to 20 of 24

Thread: Rotating Menu ...continued

Threaded View

  1. #1
    Senior Member
    Join Date
    Jul 2009
    Posts
    167

    Rotating Menu ...continued

    hi all

    still progressing with the rotating menu, I am trying change the values so that I can position correctly but I can't seem to tweak it?

    as the menu rotates the other images resize and get smaller, I think its somewhere within the script that is doing this, I would like it not to resize as it rotates away from center.

    but I can't seem to find what is making it do this?

    is this making any sense, i have been changing these values, but not quite working;


    values I have been looking at on the circleMenu.as at line 38

    Code:
    private var _activeItemScale:					Number				= 0.7;   
    		private var _minVisibleScale:					Number				= -2.9; 
    		private var _minVisibleAlpha:					Number				= 0.5;

    this changes the sizes of images but does not effect resize as it rotates?



    and this at line 155


    Code:
    public function get visibleItems():int
    		{
    			return _visibleItems;
    		}
    		
    		public function set visibleItems( value:int ):void
    		{
    			if ( value < 2 ) value = 2;
    			if ( value / 2 is int ) value += 1;
    			
    			_visibleItems = value;
    			_maxOffset = Math.round( value / 2 );
    			positionItems();
    		}

    and line 383

    Code:
    private function positionItems():void
    		{
    			if ( numChildren == 0 ) return;
    			
    			var maxAngle:Number = _maxOffset * _angleSpacing;
    			
    			var item:Sprite;
    			var hideItem:Boolean;
    			var angle:Number;
    			var offset:int;
    			
    			var tX:Number;
    			var tY:Number;
    			var tS:Number;
    			var tR:Number;
    			var tA:Number;
    
    			for (var i:int = 0; i < numChildren; i++) 
    			{
    				offset = (i + 1) - _currentIndex;
    				angle = limit(offset * _angleSpacing, -180, 180) * toRADIANS;
    				hideItem = Math.abs( offset ) >= _maxOffset;
    				
    				item = super.getChildAt(i) as Sprite;
    				item.mouseChildren = !hideItem;
    
    				tX = _innerRadius * Math.cos( angle );
    				tY = _innerRadius * Math.sin( angle );
    				tS = offset == 0 ? activeItemScale : 1 - ( Math.abs(offset / (_maxOffset - 1)) * ( 1 - minVisibleScale ) );
    				tR = angle * toDEGREES;
    				tA = hideItem ? 0 : 1 - ( Math.abs(offset / (_maxOffset - 1)) * ( 1 - minVisibleAlpha ) );
    				
    				if ( tS < 0 ) tS = 0;
    				
    				TweenLite.to( item, 0.5, { x:tX, y:tY, rotation:tR, scaleX:tS, scaleY:tS, alpha:tA, ease:Expo.easeOut } );
    			}
    		}

    I have been trying to change the values with the as files but I cannot seem to get the menu how I want it regarding size and space of images, everytime I change a value it makes another part of the menu images to resize???

    would anyone beable to help with any suggestions as to which are the correct values to change within the main.as and/or circleMenu.as

    if you like you can download the files from the links below, I have attached a jpg layout of what I am trying to get it looking like

    cs4
    http://art.clubworldgroup.com/rotate_menu_cs4.zip

    cs3
    http://art.clubworldgroup.com/rotate_menu_cs3.zip


    I have also attached a folder containing just the as files

    main.as & circleMenu.as

    many thanks for any help
    Attached Images Attached Images
    Last edited by Donkey kong; 07-28-2009 at 10:25 AM.

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