Jump to content
Search Community

ErinD

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by ErinD

  1. Hello,
     
    I am creating a barometer that has an interactive needle for the user to adjust. I used the draggable type rotation to set it to spin, however when I tried putting in the bounds, (bounds:{minRotation:0, maxRotation:90}), it is not recognizing the bounds at all. Also, when I have tried to get the info on where the needle's last rotation degree lands (onDragEnd:function() { console.log(this.rotation);}), the console logs it as undefined. Any clues why this is not being applied?
     
    Thanks,
     
    ErinD
     
     

    function init()
    {
    	console.log("yeash!!!!");
    	needleImg= document.getElementById("bNeedle");
    	barometerImg=document.getElementById("barometer");
    	smallForm=document.getElementById("groupThis");
    	//console.log(needleImg);
    
    	TweenMax.to(needleImg, 3, {css:{rotation:145, transformOrigin:"193px 47px"},ease:Elastic.easeOut});
    
    	Draggable.create(needleImg, 
    	{
            type:"rotation",
            throwProps:true,
            onDragEnd:function() { console.log(this.rotation);},
            bounds:{minRotation:0, maxRotation:90}
        }); 
    }
    
    
  2. Hi, here is the code:

     

    function thumbClicked(evt:MouseEvent):void

    {

    var num:uint = thumbArray.indexOf(evt.currentTarget);

    var swfd:SWFLoader;

    if (swfd == null)

    {

    swfd = new SWFLoader("img/" +folioXML.piece[num].filename, {onProgress:swfProgress, bgColor:0xffffff, scaleY:.71, scaleX:.73, container:movieContainer});

    swfd.load();

    }

    else

    {

    swfd.unload();

    removeChildAt(0);

    swfd = new SWFLoader("img/" +folioXML.piece[num].filename, {onProgress:swfProgress, bgColor:0xffffff, scaleY:.71, scaleX:.73, container:movieContainer});

    swfd.load();

    }

    captionHolder.text = folioXML.piece[num].description;

    titleName.text = folioXML.piece[num].title;

     

    addChild(newMask);

    newMask.y = 30;

    movieContainer.mask = newMask;

    var movBack:createMask = new createMask(582, 350, 0xffffff);

    addChildAt(movBack, 15);

    swapChildrenAt(0, 15);

    movBack.y = 30;

    TweenMax.to(movBack, .01, {dropShadowFilter:{color:0x333333, alpha:.8, blurX:6, blurY:6, distance:6}});

    }

     

    I appreciate you taking the time to take a look!

     

    Thanks

×
×
  • Create New...