Jump to content
Search Community

Search the Community

Showing results for tags 'actionscript3'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GreenSock Forums
    • GSAP
    • Banner Animation
    • Jobs & Freelance
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Product Groups

  • Club GreenSock
  • TransformManager
  • Supercharge

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Personal Website


Twitter


CodePen


Company Website


Location


Interests

Found 5 results

  1. Hello. I have a problem and im not sure how to solve it (with the BlitMask technic). Currently Im trying to create a mask (which I can more around the stage) that shows only a fragment (lets say 50x50) of the main movie clip.The main MC (lets name it Rainbow) has elements that are moving in it (like i black ball that goes from 1 corner to the other corner and then repeats that infinitely ). So what it is supposed to be happening is this: There is the main MC which stays at stage.x and stage.y and then there is my little new element (lets name it frac ( from fraction )), which i can move freely anywhere on the stage. This element (frac) shows that portion of the main MC every single frame, so when the ball in the main MC moves through that area ( the area that frac specified to watch ), frac shows that movement in itself. I currently have made it work with using flash.geom.Matrix; and bitmapData;. it is something like this: public class Main extends MovieClip { private var bmd:BitmapData; private var countainer:Sprite = new Sprite(); private var bm:Bitmap = new Bitmap(); private var myRainbow:Rainbow = new Rainbow();//the moving MC public function Main() { this.addChild( myRainbow ) myRainbow.x = stage.x; myRainbow.y = stage.y; bmd = new BitmapData( 50, 50 ); bm.x = 0; bm.y = 0 countainer.addChild( bm ); addChild( countainer ) countainer.x = 100 countainer.y = 100 addEventListener(Event.ENTER_FRAME, onFrame); addEventListener(MouseEvent.MOUSE_UP, drop); } private function onFrame( event:Event ) { bmd.draw( myRainbow, new Matrix( 1, 0, 0, 1, 0, 0 ), null, null, new Rectangle( 0, 0, 50, 50 ) ); // the last two numbers of the Matrix show the starting point of where the mask will show bm.bitmapData = bmd; } } But with this solution the performance is extremely poor. So I searched the net in a more performance friendly solution and found the BlitMask technic. So is there a way of doing this with the BlitMask??? to be more clear I`ve uploaded the fla- file that I`ve made with the code above so you can see what Im doing the link is : https://drive.google.com/file/d/0B5u6hrR2w7UEYmFHbHdlWnlWNjA/edit?usp=sharing
  2. Hello GreenSock community! I have a question for you. I've been working on a image scroller of some images, and got this working how'd I'd like. However my client has now requested an infinite scrolling gallery. I've done some research and found a script that seems to have the potential to do what I want to do, however it would need some modifications to behave as the client has requested. So right now this script auto scrolls a row of images, adding the appropriate image on to the end of the row with each scroll. I'd like to modify this to have it not auto scroll, but be controlled by a left and right arrow, and be scrollable to either the left or right. If anyone could help me out that would be great. Here is the code I have so far: import com.greensock.*; var startX:Number=parent_mc.x; var distanceToScroll:Number = 44; var lastItemX:Number = parent_mc.width function scrollIt() { TweenMax.to(parent_mc, .54, {x:String(distanceToScroll), onComplete:resetDelay}); } function resetDelay(){ TweenLite.delayedCall(.5, reset); } function reset() { //move all clips over to the right for each (var mc in parent_mc) { mc.x+=distanceToScroll; if (mc.x >= lastItemX) { mc.x-= lastItemX; } } //shift the parent so it looks like nothing moved parent_mc.x = startX //scroll it again after 1 second TweenLite.delayedCall(.2, scrollIt); } btn.addEventListener(MouseEvent.CLICK, toggleMask) function toggleMask(e:Event = null):void{ parent_mc.mask = (parent_mc.mask) ? null : mask_mc } toggleMask(); TweenLite.delayedCall(1, scrollIt); Here is it moving backward import com.greensock.*; var startX:Number=mask_mc.x; var distanceToScroll:Number = 44; var lastItemX:Number = parent_mc.width parent_mc.x = startX function scrollIt() { TweenMax.to(parent_mc, .54, {x:String(-distanceToScroll), onComplete:resetDelay}); } function resetDelay(){ TweenLite.delayedCall(.5, reset); } function reset() { //move all clips over to the right for each (var mc in parent_mc) { mc.x-=distanceToScroll; if (mc.x < 0) { mc.x+=lastItemX; } } //shift the parent so it looks like nothing moved parent_mc.x = startX //scroll it again after 1 second TweenLite.delayedCall(.2, scrollIt); } btn.addEventListener(MouseEvent.CLICK, toggleMask) function toggleMask(e:Event = null):void{ parent_mc.mask = (parent_mc.mask) ? null : mask_mc } toggleMask(); TweenLite.delayedCall(1, scrollIt); Let me know how to make this scroll on onclick only and left and right - I feel like it's close...
  3. Hi there. Can someone demonstrate how I would pass a numerical value to positioning setting such as x or y that is set in a variable from an array using Tweenlite if possible? (tweenmax?) For example, the Flash tween version: var myNumber : Number = 0; var myArray : Array [30, 20, 10]; new Tween(instance_mc,"x",Regular.easeOut,instance_mc.x,myArray[myNumber],1,true); Thanks for any help!
  4. I received a 300x250 banner ad designed in Flash Cs6 from our digital agency. I need to create several other banner sizes (180x150, 728x90, 160x600) based on this design. They used TweenNano. My question is do I need to change the actionscript 3 code depending on the size of the file? This may seem like a silly question, but I haven't used Greensock before and have very little actionscript 3 knowledge. The script is included, do I need to upload the Flash file too? Thanks so much for any assistance! actionscript.txt
  5. Hi, everyone! I want to add functionality to my photo gallery app (Air mobile) - different types of animation of the thumbs of the photos. Now I did like the code below. This is the simplest move left-right and top-bottom. But I need more different patterns of animation y- the movement as a 3D carousel, spinning in a circle, orbiting, movement of the sun's rays and back, movement along the wave path etc. I would be very grateful if you have a ready-made pieces of code for these and similar animations with help TweenLite lib. [bindable] private var stageW:int = Capabilities.screenResolutionX; [bindable] private var stageH:int = Capabilities.screenResolutionY; private var itemsVector:Vector.<Image>=new Vector.<Image>(); private var xSpeedVector:Vector.<Number>=new Vector.<Number>(); private var ySpeedVector:Vector.<Number>=new Vector.<Number>(); stage.addEventListener(Event.ENTER_FRAME, update); private function moveSetup():void { for(var i:int = 0; i < FlexGlobals.topLevelApplication.objects.length; i++){ if (FlexGlobals.topLevelApplication.objects[i] is Image){ var item:Image=FlexGlobals.topLevelApplication.objects[i] as Image; item.x=Math.random()*stageW; item.y=Math.random()*stageH; var randomDirection:Number=Math.random()*2*Math.PI; this.addElement(item); itemsVector.push(item); xSpeedVector.push(2*Math.cos(randomDirection)); ySpeedVector.push(2*Math.sin(randomDirection)); } } } protected function update(event:Event):void { for(var i:uint=0;i<itemsVector.length;i++){ itemsVector[i].x+=xSpeedVector[i]; itemsVector[i].y+=ySpeedVector[i]; if(itemsVector[i].x>stageW){ itemsVector[i].x-=stageW; } if(itemsVector[i].x<0){ itemsVector[i].x+=stageW; } if(itemsVector[i].y>stageH){ itemsVector[i].y-=stageH; } if(itemsVector[i].y<0){ itemsVector[i].y+=stageH; } } } .
×
×
  • Create New...