Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Other Programming › Flash & Actionscript › [Collection]Snippets Vault[Flash]

[Collection]Snippets Vault[Flash]

Posts 1–4 of 4 · Page 1 of 1
NextGen1
NextGen1
[Collection]Snippets Vault[Flash]
Use this format for submitting snippets

It may be used later to parse the snippets to a application (like the one in the VB Section)

If you're going to post a snippet in this thread then you should be posting it in the following format:

Snippet Name: ____________________
Keywords: ____,____,____ ...
Description(Optional): _______________________
Code:
Code:
Your Code Here...
This is to be used for any small bit of code you would like to share.


#1 · 15y ago
Hassan
Hassan
Snippet Name: Shuffle Array (Action Script 3)
Keywords: Flash,Shuffle,Array,AS3
Description: This reorders the elements of an array into a random order.
Code:
var anArray:Array = [1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4];
anArray=shuffleArray(anArray);

function shuffleArray(arr:Array):Array{
 var arr2:Array = [];
 while (arr.length > 0){
  arr2.push(gendersArray.splice(Math . round(Math.random() * (arr.length - 1)), 1)[0]);
 }
 return arr2;
}
Snippet Name: Convert a String into an Array Using Action Script 3
Keywords: String To Array, AS3
Description: Converts the string into an array using the actionscript "split" function.
Code:
//the string to turn into an array
var arrayString:String="1,2,3"; 
//convert the string to an array using the "," as a divider (aka delimiter)
var newArray:Array= arrayString.split(",")  
//convert the array items from strings to numbers
var n=newArray.length;
 while (n--) {
  newArray[n]=Number(newArray[n])
 }
trace(String(trainCubesArray[0]+1));

Snippet Name:
Detecting when mouse leaves stage.
Keywords: Mouse Detection, AS, Flash, Rollover, Hover
Description: This is how you detect if the mouse leaves Flash and rolls over to web page:
Code:
var c:Sprite = new Sprite();
c.graphics.beginFill(0xFF);
c.graphics.drawRect(0, 0, 200, 200);
addChild(c);
stage.addEventListener(Event.MOUSE_LEAVE, cursorHide);
//there is no mouse exit so you need to use this
stage.addEventListener(MouseEvent.MOUSE_MOVE, cursorFollow);
function cursorHide(evt:Event):void {
 c.alpha=.2
}
function cursorFollow(evt:MouseEvent):void {
 c.alpha=1
 evt.updateAfterEvent();
}


Snippet Name:Blur Using AS3
Keywords: Blur,Flash,AS3,AS4
Description:Creates a blur effect on movie clips.
Code:
var blur:BlurFilter = new BlurFilter();
blur.blurX=20;
blur.blurY=20;
blur.quality=BitmapFilterQuality.LOW;
displayObjectToBlur_mc.filters=[blur];
Snippet Name:AS3 full screen mode
Keywords: AS3, FullScreen, Mode
Description:Toggles full screen mode using AS3.
Code:
function toggleFullScreenMode(e:MouseEvent):void {
 if (viewingFullScreen==false) {
  viewingFullScreen=true;
  navsNorthMultiPage_mc.tween_mc.eastButtons_mc.fullScreenAnim_mc.gotoAndPlay("full");
  navsSouthMultiPage_mc.tween_mc.eastButtons_mc.fullScreenAnim_mc.gotoAndPlay("full");
  stage.displayState="fullScreen";
 } else {
  viewingFullScreen=false;
  navsNorthMultiPage_mc.tween_mc.eastButtons_mc.fullScreenAnim_mc.gotoAndPlay("out");
  navsSouthMultiPage_mc.tween_mc.eastButtons_mc.fullScreenAnim_mc.gotoAndPlay("out");
  stage.displayState="normal";
 }
}
Snippet Name:AS3 Disable Yellow Tab Rectangles
Keywords:Disable, AS3, Tab, Rectangles
Description:Are you wondering why when you hit tab in your Flash site you get those nasty yellow rectangles around your links? Here's how to disable them:

If you have a movieclip with a bunch of buttons inside it and you want to disable all of them with one line of code use this:

Code:
MC_Container_Name.tabChildren = false;
Or to just disable the yellow box on a single movieclip use this:

Code:
MC_Name.tabEnabled = false;
Snippet Name:AS3 Smooth Loaded Bitmaps
Keywords:AS3,Smooth,Loaded,Bitmaps
Description: Loaded bitmaps (jpgs, pngs, etc) look bad in flash when scaling unless you smooth them. This function seems to replicate the bitmap "smoothng" setting in the library pallette. I still see tons of Flash sites out there that arent aware of this awesome setting. It makes bitmaps look great when they scale.
Code:
//create a new loader object and put it on the stage
var slideLoader:Loader=new Loader();
this.addChild(slideLoader);

//load picture into loader object
slideLoader.contentLoaderInfo.addEventListener(Even*****MPLETE, scaleContentForPicture);
slideLoader.load(new URLRequest("http://www.mpgh.net/forum/images/tree.jpg"));

//smooth it once loaded
function scaleContentForPicture() {
var smoother_bm=Bitmap(slideLoader.content);
smoother_bm.smoothing=true;
}
Snippet Name:Slideshow with autoplay and reset delay
Keywords:AS3,Slideshow,autoplay
Description: This code starts with a long pause then starts looping through images. If the user interacts with the slideshow, the timer is reset then starts playing again later if the user hasnt interacted.
Code:
var resetTime:uint=5000;
var pauseBetweenSlides:uint=5000;
var slideCounter:uint=1;
var prevSlide:uint=0;

var startShowTimer:Timer=new Timer(resetTime,1);
startShowTimer.addEventListener(TimerEvent.TIMER, setUpTimer);
var slideShowTimer:Timer=new Timer(pauseBetweenSlides,0);
slideShowTimer.addEventListener(TimerEvent.TIMER, autoAdvance);

//auto advance
function autoAdvance(e:TimerEvent):void {
 nexttSlide();
}

//next
function nexttSlide():void {
 prevSlide=slideCounter;
 slideCounter++;
 if (slideCounter==6) {
  slideCounter=1;
 }
 goToSlide();
}
//prev
function prevvSlide():void {
 prevSlide=slideCounter;
 slideCounter--;
 if (slideCounter==0) {
  slideCounter=5;
 }
 goToSlide();
}
//display next slide and hide previous
function goToSlide():void {
 slideshow_mc["slide"+slideCounter+"_mc"].gotoAndPlay("show");
 if (prevSlide>0) {
  slideshow_mc["slide"+prevSlide+"_mc"].gotoAndPlay("hide");
 }
}
//pause slideshow and reset timer
function resetTimer():void {
 slideShowTimer.stop();
 startShowTimer.reset();
 startShowTimer.start();
}
//called when reset pause is finished
function setUpTimer(e:TimerEvent):void {
 startShowTimer.reset();
 slideShowTimer.start();
}


resetTimer();
goToSlide();


//Controls--------
function showControls():void {
 slideShowPrev_mc.gotoAndPlay("show");
 slideShowNext_mc.gotoAndPlay("show");
}
function hideControls():void {
 slideShowPrev_mc.gotoAndPlay("hide");
 slideShowNext_mc.gotoAndPlay("hide");
}



slideShowNext_mc.addEventListener(MouseEvent.CLICK, invokeNextSlide);
function invokeNextSlide(e:MouseEvent):void {
 resetTimer();
 nexttSlide();
}
slideShowPrev_mc.addEventListener(MouseEvent.CLICK, invokePrevSlide);
function invokePrevSlide(e:MouseEvent):void {
 resetTimer();
 prevvSlide();
}
#2 · edited 15y ago · 15y ago
PO
poppin911
@Hassan do u know Adobe Dreamweaver?
#3 · 14y ago
Hassan
Hassan
Yes, I do lol. Why ?
#4 · 14y ago
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

  • [Collection]Snippets Vault[C#]By NextGen1 in C# Programming
    21Last post 6y ago
  • [Collection]Snippets Vault[PHP]By NextGen1 in PHP Programming
    13Last post 7y ago
  • Snippets VaultBy NextGen1 in Visual Basic Programming
    112Last post 7y ago
  • [Collection]Snippets Vault[Assembly]By NextGen1 in Assembly
    5Last post 13y ago
  • [Collection]Snippets Vault[D3D]By NextGen1 in DirectX/D3D Development
    0Last post 15y ago

Tags for this Thread

None