Jump to content
Search Community

Search the Community

Showing results for tags 'shuffle'.

  • 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 2 results

  1. Guest

    Dealer Cards animate to players

    Hi there, I did one example on codepen to show scenario im right now, i want the cards[array] on stagger to be showed on close on each Player (like in this image ) and not in middle as it is in example right now, can anyone give me idea how can i archive this effect,fork codepen demo would be great.
  2. Hi - I'm new to using greensock (and actionscript) and am trying to play around with some code I found. It originally loaded several swf files and looped through them continuously - I'm trying to randomize it. I have created an array and added code to shuffle through the array, but I'm stuck trying to integrate it into the looping files. I'm pretty sure I have to do something with the loaderIndex, but I'm not sure what. Any help would be great - thanks. Code: progress_mc.scaleX = 0; var loaderIndex:Number = -1; var currentLoader:SWFLoader; var urls:Array = ["SWF0.swf","SWF1.swf","SWF2.swf"]; var swfs:LoaderMax = new LoaderMax({onComplete:completeHandler,onProgress:progressHandler,onChildComplete:childCompleteHandler}); // Loop through urls and create a queue of swf loaders for (var i:Number = 0; i < urls.length; i++) { swfs.append( new SWFLoader(urls, {container:container_mc, autoPlay:false}) ); } urls.sort(randomSort); function randomSort(a:*, b:*):Number { if (Math.random() < 0.5) { return -1; } else { return 1; } } function progressHandler(e:LoaderEvent):void { progress_mc.scaleX = e.target.progress; } function childCompleteHandler(e:LoaderEvent):void { trace(e.target + " loaded"); e.target.content.visible = false; } function completeHandler(e:LoaderEvent):void { trace("all swfs loaded"); progress_mc.visible = false; initCurrentLoader(); addEventListener(Event.ENTER_FRAME, trackSWFPlayback); } function initCurrentLoader() { loaderIndex++; if (loaderIndex == swfs.numChildren) { //reset back to 0 if the last swf has already played loaderIndex = 0; } //dynamically reference current loader based on value of loaderIndex currentLoader = swfs.getChildAt(loaderIndex); //make the content of the current loader visible currentLoader.content.visible = true; //tell the current loader's swf to to play currentLoader.rawContent.gotoAndPlay(1); } function trackSWFPlayback(e:Event):void { //trace(currentLoader.rawContent.currentFrame); //detect if the loaded swf is on the last frame if (currentLoader.rawContent.currentFrame == currentLoader.rawContent.totalFrames) { trace("swf done"); //hide and stop current swf currentLoader.content.visible = false; currentLoader.rawContent.stop(); //set up and play the next swf; initCurrentLoader(); } } load_btn.addEventListener(MouseEvent.CLICK, loadSWFs); function loadSWFs(e:MouseEvent):void { load_btn.visible = false; swfs.load(); }
×
×
  • Create New...