Add mask to dynamicly image scroller Acionscript 3

Posted on 2009-04-23
Last Modified: 2013-11-11
Sorry in advance, I am a newbie to AS3!

I am looking to make a scrolling image box in Actionscript 3. It is very simple! Just an image area with a scroll bar under it. I have the scrolling image and it works good but I cant get the mask to work only as an image area.

I have posted my code below

Thank you
import fl.controls.Slider;


import fl.controls.Label;

import fl.containers.UILoader;


// AS3

var mc:MovieClip = new MovieClip();;, 0, 200, 500);;

mc.x = 0;

mc.y = 0;


mask = mc; 


var aSlider:Slider = new Slider();

aSlider.width = 200;

aSlider.snapInterval = 1;

aSlider.tickInterval = 10;

aSlider.maximum = 100;

aSlider.value = 1;

aSlider.move(120, 330);

var aLoader:UILoader = new UILoader();

var myImage:image = new image();


aLoader.scaleContent = false;



aSlider.addEventListener(SliderEvent.THUMB_DRAG, changeHandler);

function changeHandler(event:SliderEvent):void {

          aLoader.x = event.value * 5;


Open in new window

Question by:wraithlord
    1 Comment
    LVL 6

    Accepted Solution

    mask = mc;  is not correct.
    After adding your mask and scroller to the stage use:
    aSlider.mask = mc;
    by the way I suggest you to rename mc to sliderMask or smth. like that to have a understandable code...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
    This article will show, step by step, how to integrate R code into a R Sweave document
    The viewer will learn how to dynamically set the form action using jQuery.
    The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now