Trying to make Scrollable Functionality in Paint like program.

I'm wrinting a program thats a lot like MSPaint or any of the other paint variants. I have a JPanel that all of my shapes are drawn to. I need the scroll bars to show only when the shapes, which are variants of Shape2D, are to large to be shown in the window. For some reason I just can't make heads or tails of the JScrollPane documentation. If someone can just give me an example of a class that extends JPanel and has the scroll bars on it I think that I could figure it out from there.

import java.awt.*;
import java.awt.event.*;
import java.awt.geom.Line2D;
import java.util.ArrayList;
import java.util.List;
import javax.swing.*;
public class ScrollView extends JPanel {
    List<Line2D> lines = new ArrayList<Line2D>();
    final int DELTA = 30;
    final int PAD   =  5;
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        Graphics2D g2 = (Graphics2D)g;
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                            RenderingHints.VALUE_ANTIALIAS_ON);
        g2.setPaint(Color.blue);
        for(int i = 0; i < lines.size(); i++) {
            g2.draw(lines.get(i));
    public Dimension getPreferredSize() {
        double maxX = 0, maxY = 0;
        for(int i = 0; i < lines.size(); i++) {
            Rectangle r = lines.get(i).getBounds();
            if(r.getMaxX() > maxX) maxX = r.getMaxX();
            if(r.getMaxY() > maxY) maxY = r.getMaxY();
         return new Dimension((int)(maxX+PAD), (int)(maxY+PAD));
    private JPanel getLast() {
        String[] ids = { "width", "height" };
        ActionListener al = new ActionListener() {
            Rectangle rect = new Rectangle(PAD,PAD);
            public void actionPerformed(ActionEvent e) {
                String id = e.getActionCommand();
                int w = getWidth();
                int h = getHeight();
                double x1 = 0, y1 = 0, x2 = 0, y2 = 0;
                if(id.equals("width")) {
                    double lineWidth = (w-2*PAD) + DELTA;
                    x1 = PAD;
                    x2 = x1 + lineWidth;
                    y1 = y2 = h - PAD;
                } else {
                    double lineHeight = (h-2*PAD) + DELTA;
                    x1 = x2 = w - PAD;
                    y1 = PAD;
                    y2 = y1 + lineHeight;
                lines.add(new Line2D.Double(x1, y1, x2, y2));
                repaint();
                revalidate();
                rect.setLocation((int)x2, (int)y2);
                scrollRectToVisible(rect);
        JPanel panel = new JPanel();
        for(int i = 0; i < ids.length; i++) {
            JButton button = new JButton(ids);
button.setActionCommand(ids[i]);
button.addActionListener(al);
panel.add(button);
panel.setBorder(BorderFactory.createTitledBorder("expand"));
return panel;
public static void main(String[] args) {
ScrollView test = new ScrollView();
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.add(new JScrollPane(test));
f.add(test.getLast(), "Last");
f.setSize(400,400);
f.setLocation(200,200);
f.setVisible(true);

Similar Messages

  • Trying to make GNOME 3 a bit like GNOME 2

    Hello guys. I'm a GNOME fanatic but I must admit that GNOME 3 has concerned me. At first I didn't like it at all. Then I got used to it a little and after that I reminded myself that even with GNOME 2 I certainly did NOT used any of the default theme/features etc. So I need to give some time to GNOME 3 for the devs to make mods, themes etc.
    Right now 3 things concern me:
    1. I'm using Cairo Dock but I found out that I cannot drag and drop apps from the Activities menu to the dock. Any ideas how to do this? (I'm really embarassed to admit it, but after 4 years on Linux I still don't know another way to add apps to cairo dock :-/ )
    2. Is there anyway to make the system tray that appears on the down-right corner move up like GNOME 2 used to?
    3. At last, are there any widgets for the bar? I like the upper bar full or else I find it boring and useless.
    Thanks in advance!

    Sloshy wrote:What I do is I just use the built-in dock that comes with GNOME 3 on the Activities overlay. If I press the Activities Key (Windows/Super/Meta/whatever) and move my mouse to the left, it's just like a regular dock. It supports favorites of course, right-clicking, and in the future it'll get zeitgeist jumplist support! To switch apps I just use Alt+Tab and Alt+` (or whatever key's above Tab for you; it's relative). I don't even need a dock anymore, and this behavior becomes second-nature really quickly. I don't know how to add an application to cairo-dock, but I think the devs will make a workaround for it eventually. Until then, try it without a dock and see if you can get used to it
    I have applications that do NOT work properly with Mutter/gnome-Shell. VMware guests that are hardware accelerated perform badly. Autodesk Maya doesn't work properly... Mutter is much slower than compiz, and is not easily tweakable without knowledge of javascript and CSS . - that is brutal! 
    I have over 200 gestures that i use on my desktop (easystroke), little to almost none of which are transferable to Gnome-Shell. Compiz is a much better way to go for tablet use. I don't require remembering any hotkeys, at all - for any purpose on my desktop - why would i want to learn all of gnome-shell's??? I wouldn't, that's a waste of my time and my workflow is much faster. I only use the keyboard to type text, or for hotkeys in applications that i use, where it makes sense too.
    I can add/remove workspaces WITHOUT leaving my even desktop in cairo-dock. (in fact i can do anything gnome-shell does without leaving my desktop). to switch to open applications i draw a circle on the screen - it enables the scale plugin in compiz ~ the scale plugin in GnomeShell is inferior. Scale in compiz can focus on an application (handy when you have many applications open, it zooms in on the app without switching to it - when you have a dozen apps open it's awesome), i can also close applications in scale by using a right-click. Not only that but compiz' scale plugin will show me all applications relative to their own workspace. (and it is customizable).
    Compiz also performs as a tiling window manager - gnome-shell's new "snap plugin" - is in compiz, and has been for a quite while. Not only that compiz' is better. it has more functionality and is again - totally customizable! going back to the tiling aspect - if i have 2 windows open that i would like to have each snap to the sides / splitting them across the desktop - i draw a "box" on my screen. not only that, but this works with 4 applications open too.
    You don't need a dock, because gnome-shell has it's own way of doing things - i PREFER a dock, anytime i am required to leave my desktop to achieve something, whether it is seraching for a file, or looking/opening an appliction -  i consider that to be bad UI design...and trying to compare "activities" to cairo-dock is laughable. activities is a somewhat feature-less attempt at replacing other opensource projects that already exist and are much better....and yes, i am sure Cairo-dock will be fixed.
    jordan
    Last edited by triplesquarednine (2011-05-02 00:01:25)

  • Frustrated - trying to make button function

    Hello,
    Okay, here's an example of what I want to do on this site:
    http://www.templatemonster.com/flash-templates/8549.html
    I am creating my first website in Flash and need help with my
    Actionscript. I made three buttons, which are inside my intro page
    movieclip called mcIntro. When you click the buttons, I want it to
    take them to a frame label on the main timeline (in the case below,
    "print"). Then I want the movieclip that's on the "print" section
    to go and play an animation with the frame labeled "in". Then,
    depending on whether the web section, print section, or main
    section is visible, I want the section they're leaving to go to the
    "out" animation. Here's what I did, and it didn't work.
    mcIntro.bPrint.onRelease = function() {
    _root.gotoAndPlay("print");
    mcPrint.gotoAndPlay("in");
    if (mcWeb._visible) {
    mcWeb.gotoAndPlay("out");
    if (mcIntro._visible) {
    mcIntro.gotoAndPlay("out");
    Help is appreciated, thanks!

    This sounds like the same problem as in this earlier post today... not properly naming the button instance...
    http://forums.adobe.com/thread/856044?tstart=0

  • Trying to make Macs compatible with windows-based programs.

    We have a Mac shop and are trying to set it up to run windows-based programs. I think I'm supposed to use Terminal Services for this but I don't know much about Terminal Server. Could anyone point me in the right direction for setting up our Mac machines to run windows software?

    Windows software cannot run natively on a Mac OS X.
    If you have a Windows server running Terminal Services, then on the Mac side you'll need the Microsoft Remote Desktop Connection client.
    This will allow you to open up a Windows Terminal Services session on your Mac.
    If you are not running a Terminal Server of some sort, and you wish to run Windows apps directly on the Mac... then you'll need Microsoft VirtualPC installed and configured on each Mac.

  • Is there a windows "paint" like application on my macbook?

    if anyone has any tips, id appreciate the knowledge.

    I downloaded several different programs and ended up deleting them all. I could not find one that worked as well as MSPaint. which is sad since wasn't the original 1984 mac known for its paint like program-- GUI interface and all.
    I wanted to take several pictures of the apple logo and put all of them on my desktop as the background and sadly I had to use a windows machine and used paint to do it.
    "My screen name is don't make me switch back, so don't make me answer my questions and tell me why mac is better."

  • Trying to make paint stroke look like it's been written with sauce.....

    Hi,
    I'm trying to use the paint tool to write some words. The words are supposed to look as if they've been written with sauce or some other kind of viscous fluid. I've tried lots of options with the paint tool and then tried to modify the paint stroke further. But somehow it always looks to "clean", not blotchy or random enough.
    Does anyone have any good ideas of how to go about this?
    Thanks a lot in advance for any kind of input or idea!!

    the one i posted was a psd file using a smart object. Double click the smart object it then opens a new file, you add the photo you need, as you from the example that image is wide screen, my photo wasn't, so you use the 2nd file to make the photo fit how you want, then save and it then alters the original file, hence smart object. The background too was one, hence the perspective.
    The splicing etc is ok , as you say if you have an odd one to do.
    So essentially you make up the smart object once and then reuse. As you woudl need to make the canvas / canvas's into several templates for your liking, be it square / portrait / landscape or even spread over several canvases
    The example i showed here is an illusion, but a pretty good one, It NOT 3d. Its done with shadows, this is the smart object.
    as you see its just a perspective rectangle with the top and bottom left cropped off for the depth.
    these are the psd layers as you see there are only 5, its not an action, but googling i did see an action, i think it was $35. But as i said bear in mind the amount of possible boaard canvases you may want.
    2 of the other layers as you see are for the lighting and the top one is the 3d illusion effect, this particular one has the canvas effect too. I can't remember where i got this one from. I think graphic river do 3d canvas though, there will be others.
    Another thing to consider if using an action is if it can do multiple boards. like ...
    again just to show you before the illusion
    Pretty much example like the emboss effect you can use, all done with lighting and darkness.
    http://graphicriver.net/item/more-canvas-mockups/2581097?ref=riverpsd
    http://graphicriver.net/item/canvas-mockups/917210?ref=riverpsd
    there will be other avenues if you google

  • While editing photos in Aperture, I'm trying to make an "auto" adjustment to the exposure but the button is grayed out and consequently doesn't perform any function, please help! Thank you, Mike

    While editing photos in Aperture, I trying to make an "auto" adjustment to the exposure,
    but the "auto" button is grayed out and will not allow any auto function to take place.
    Please help!
    Thank you,
    Mike

    Mike, are you working with raw images?
    For some raw images auto exposure is not available, have a look at this manual page:
    http://documentation.apple.com/en/aperture/usermanual/index.html#chapter=18%26se ction=9%26tasks=true
    Note: Automatic exposure adjustment is available for Aperture-supported RAW images only. If you want to adjust the exposure of another file type, such as JPEG or TIFF, see Working with the Exposure Controls. For a list of supported RAW file types, go to the Apple website at http://www.apple.com/aperture/specs.

  • I am trying to make a fraction in a form field and I would like it to have an over/under appearance. Is this possible?

    I am trying to make a fraction in a form field and I would like it to have an over/under appearance. Is this possible?

    What system and iPhoto version are you running?  What theme are you using.
    All of my calendars do have the month starting on Sunday,  Don't know of any way to change it.  Where are you located?
    How do you have your Calendar application's preferences set to, Sunday or Monday start of week? 

  • I am trying to make a calendar in iPhoto and I would like the month to start on Sunday , not Monday. Is that possible and if so how can i do that???? thanks.

    i am trying to make a calendar in iPhoto and I would like the month to start on Sunday , not Monday. Is that possible and if so how can i do that???? thanks.

    What system and iPhoto version are you running?  What theme are you using.
    All of my calendars do have the month starting on Sunday,  Don't know of any way to change it.  Where are you located?
    How do you have your Calendar application's preferences set to, Sunday or Monday start of week? 

  • I'm trying to make a AUTO slide show. I can select all the other actions like mouse clicks etc. but

    I'm trying to make a AUTO slide show. I can select all the other actions like mouse clicks etc. but ON load will not work.
    PLEASE HELP>
    I do not know how to reload/reinstall "ADOBE" golive default actions. I'm using golive cs mac version and "ON LOAD" action. I can't select it when creating a golive action.....It converts it or something to a rollover..
    How can I reistall basic adobe actions???
    Is it a bug???
    Is it a known issue???
    Do I need something??
    Am I missing something???
    Thanks a bunch..
    Kev

    In article <[email protected]>,
    [email protected] wrote:
    > I do not know how to insert the auto slideshowaction as a head action item.
    > The steps.
    > Can you explain how to do it?
    I just remembered I have a couple of screen snaps online to explain how
    it's done:
    1. place your base image and name it in the inspector
    2. from the smart objects palette grab the head action item, the one
    with a question mark in its upper, green half - the 2nd one from the
    left. Drop that into the pages head section.
    3. in the inspector set the action to run OnLoad and select the base
    image that you named in the first step and set the other parameters.
    This was done in the days of GL6, but not much had changed in GL CS.
    Anyway you might also refer to GL's online help. It describes how to set
    up all the actions that ship with GL.
    Cheers Martin

  • I bought creative suite production 6 2 years ago. On 12/24 I guess an update came thru and screwed my program all up. Its trying to make we buy to go into the cloud. I'm happy with what I have, I don't went to go into the cloud. I truely feel like Im bein

    I bought creative suite production 6 2 years ago. On 12/24 I guess an update came thru and screwed my program all up. Its trying to make we buy to go into the cloud. I'm happy with what I have, I don't went to go into the cloud. I truely feel like Im being ripped off being forced to move into the cloud'

    uninstall, clean and reinstall per, Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6

  • JScrollPane, JPanel used to make a paint-like application

    I am new to swing. I need help with implementing a paint-like application using JScrollPane and JPanel.
    I have put a JPanel inside a JScrollPane.
    The size of JPanel exceeds preferred size of JScrollPane, and i can see the scrollbars, and can go up and down.
    Problem is, when i draw on the JPanel, i can see what i've drawn very clearly. Now if I scroll down, and then scroll back up, whatever i had previously drawn has been erased.
    let me put it in a simpler manner. suppose i have drawn a filled circle whose diameter is equal to the viewport size of the JScrollPane. Now i am scrolling down till i can see only the bottom half of the circle. When i scroll back up, the upper half of the circle has been erased.
    i think this is a newbie error, and i guess it'll have a textbook response, so i have not bothered to paste my entire code here. however, if it is required, please let me know.

    Sounds very much like you're painting outside the paint cycle. Read this,
    http://java.sun.com/products/jfc/tsc/articles/painting/
    When the user draws on the screen, you want to do one of two things (these being just the most obvious and easiest implementations). For raster operations you want to manipulate an Image; for vector operations you want to manipulate a collection of Shapes.
    Your paintComponent() method of the panel should simply draw the stored images and shapes to the supplied Graphics object as appropriate.
    If you paint to a Graphics object outside the paint cycle then it will all be erased when the paint cycle is next invoked.

  • Help : Lost in Code - Trying to make a simple Click-Through

    Hey Everyone -
    I've come in search of some help and expertise. I've found a
    website which I would like to copy in functionality - in hopes of
    creating a simple slideshow of images. They are using the MOOTOOLS
    framework for the Slide animation - i've gotten that to work
    - but i can't figure out how to replicate the clickthrough-
    SO - what i'm trying to do is copy this page exactly -
    http://www.thegraphicgraphic.com/
    you'll see that it's just three lines of text ( rollovers )
    and the last line opens up a javascript slider window - now i've
    managed to copy most of it by taking the code and figuring out the
    urls for the javascript and such .
    check out my version here :
    http://www.nontype.com/beograd.html
    i've got the css and java stuff working okay - but what i
    can't seem to figure out at all is how they are getting the
    rollover links to link to the NEXT IMAGE - they're using some tags
    that i don't understand : it looks something like this : : :
    <div id="header">
    <ul>
    <li>
    <a href=""
    onmouseover="this.innerHTML = 'NEXT'"
    onmouseout="this.innerHTML = 'THE'">
    THE</a>
    </li>
    <li>
    <a href=""
    onmouseover="this.innerHTML = 'PREVIOUS'"
    onmouseout="this.innerHTML = 'GRAPHIC'">
    GRAPHIC</a>
    </li>
    <li>
    <a href="#" id="button" onmouseover="this.innerHTML =
    'INFORMATION'"
    onmouseout="this.innerHTML = 'GRAPHIC'">
    GRAPHIC</a>
    </li>
    </ul>
    </div>
    AND The JAVASCRIPT Used for both the sliders ( and I assume
    the click-through functionality ) is :
    window.addEvent('domready', function() {
    var Slider = new Fx.Slide('about',{mode: 'horizontal',
    duration: 100}).hide();
    $('button').addEvent('click', function() {
    Slider.toggle('horizontal');
    function noSpam(user,domain) {
    locationstring = "mailto:" + user + "@" + domain;
    window.location = locationstring;
    function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
    I just want to click NEXT to progress to the next background
    image / and PREVIOUS for the prev. image . . . . . . . . Could
    anyone here tell me how to do this as in the first site ? ? ? Would
    I be able to simply create multiple HTML Pages - use an Embed tag -
    and then link the PREV and NEXT buttons with tags ?
    I'm just trying to make this work by any means but am finding
    the code impossible to crack -
    I tried asking this question in the mootools forum but was
    told to look elsewhere - I'm more than willing to use
    any other means in order to make this work .
    MANY THANKS IN ADVANCE FOR YOU HELP . . .

    Have you asked the authors?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "aerolex" <[email protected]> wrote in
    message
    news:f2naeu$q66$[email protected]..
    > Hello - would anyone have any advice - or should i
    somehow reword the
    > question ?
    >
    > or could some provide some insight as to where i might
    look to resolve
    > this question ?
    >
    > THANKS AGAIN

  • Trying to make Tile Transition Effect a rollover effect

    Hello all-
    I'm a newbie to AS3 and I'm hoping someone can help me. I am trying to make the Tile Transition Effect, from flash-filter.net, into a rollover effect. I originally began working off of the 3D Cube Rollover Transition script and I was able to get the rollover part to work but as soon as the first transition is done I get this error message:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at net.flashfilter.as3.effects.tileflip::TileFlip3D/processFrame()
    at net.flashfilter.as3::PaperBase/onRenderFrame()
    I realize that the error itself means that I am trying to call something that is not instantiated yet, but I am unsure where my code is wrong, and I am also unclear on what the 2nd and 3rd lines mean. Here is the code:
    btn.addEventListener(MouseEvent.ROLL_OVER, _onOver);
    btn.addEventListener(MouseEvent.ROLL_OUT, _onOut);
    var running = false;
    var goIn = false;
    var goOut = false;
    function _onOver(e:MouseEvent){
    if(!running){
    _createAnimation("in");
    running = true;
    }else{
    goIn = false;
    goOut = true;
    function _onOut(e:MouseEvent){
    if(!running){
    _createAnimation("out");
    running = true;
    }else{
    goIn = true;
    goOut = false;
    function _inAnimationDone(e:Event){
    e.target.removeFilter();
    img1.visible = false;
    if(goIn){
    _createAnimation("out");
    }else{
    running = false;
    goOut = false;
    function _outAnimationDone(e:Event){
    e.target.removeFilter();
    img2.visible = false;
    if(goOut){
    _createAnimation("in");
    }else{
    running = false;
    goIn = false;
    function _createAnimation(dir:String){
    var myFilter:TileTransitionEffectAS3 = new TileTransitionEffectAS3();
    myFilter.mouseEnabled = false;
    myFilter.mouseChildren = false;
    addChild(myFilter);
    if(dir == "in"){
    myFilter.init(img1, img2, 10, 20, 40, 40, "Mode7", "l->r");
    myFilter.addEventListener(TileTransitionEffectAS3.ANIMATION_DONE, _inAnimationDone);
    }else if(dir == "out"){
    myFilter.init(img2, img1, 10, 20, 40, 40, "Mode7", "r->l");
    myFilter.addEventListener(TileTransitionEffectAS3.ANIMATION_DONE, _outAnimationDone);
    Thanks in advance to anyone that might be able to shed some light on the situation!

    I'm assuming that you want to do something like the push into all of the stills. There's no real trick, there is just a bunch of work. You have to distribute your layers in 3D space and animate the camera. I'd suggest you start with simple moves with just 3 or 4 layers. Get that right, then start adding layers until you've achieved the complexity you desire.
    If I had the artwork and were to try and match the camera move that happens around 7 seconds I'd budget about a half hour. The move from 15 seconds to about 18 seconds is mostly a single setup repeated 3 times. Something that complex would take me about an hour and a half but it could easily take all day, depending on the images needed and whether or not I had to do a bunch of resizing to complete the project.
    The other option would be to use the Card Dance plug-in. Card Dance is a complex plug-in that requires some training to use. To learn more type card dance into the search field in AE and look at the training materials. The move on the red layer with all the squares at about 1:47 could be created quite quickly with Card Dance. 

  • HI Im trying to make my as3 start on a specific frame but for some reason I just cant find a solutio

    THe below is the AS and i am trying to make it start on a specific frame, can anyone help me please?
    package
    import fl.controls.Button;
    import flash.display.Bitmap;
    import flash.display.Loader;
    import flash.display.MovieClip;
    import flash.net.FileFilter;
    import flash.net.FileReference;
    import flash.text.TextField;
    import flash.text.TextFieldType;
    import flash.events.MouseEvent;
    import flash.events.Event;
    public class BitmapLoader extends MovieClip
      private static const _MAX_WIDTH: Number = 640;
      private static const _MAX_HEIGHT:Number = 410;
      private var _fileRef:FileReference;
      private var _fileFilter: FileFilter;
      private var _loader: Loader;
      private var _bitmap:MovieClip;
      private var _browseBtn:Button;
      private var _staticTxt:TextField;
      private var _browseTxt:TextField;
      public function BitmapLoader( )
       _init( );
      private function _init( ):void
       _staticTxt = new TextField ( );
       _staticTxt.type = TextFieldType.DYNAMIC;
       _staticTxt.x = 10;
       _staticTxt.y = 10;
       _staticTxt.height = 21;
       _staticTxt.text = "Select a Video:";
       addChild( _staticTxt );
       _browseTxt = new TextField ( ) ;
       _browseTxt.type = TextFieldType.INPUT;
       _browseTxt.x = _staticTxt.x + _staticTxt.width + 4;
       _browseTxt.y = 10;
       _browseTxt.height = 21;
       _browseTxt.width = 200;
       _browseTxt.border = true;
       _browseTxt.background = true;
       addChild( _browseTxt );
       _browseBtn = new Button ( ) ;
       _browseBtn.label = "Browse";
       _browseBtn.name = "browse";
       _browseBtn.x = _browseTxt.x + _browseTxt.width + 4;
       _browseBtn.y = 10;
       _browseBtn.useHandCursor = true;
       _browseBtn.addEventListener(MouseEvent.CLICK, _handleMouseEvent);
       addChild( _browseBtn );
       _fileFilter = new FileFilter("clips","*.swf;*.flv;*.f4v;*.mov;*.mp4");
      private function _handleMouseEvent( evt : MouseEvent ):void
       switch ( String ( evt.target.name ))
        case "browse" :
         _fileRef = new FileReference ( ) ;
         _fileRef.browse( [_fileFilter]);
         _fileRef.addEventListener( Event.SELECT, _onImageSelect);
         trace( "Browse" );
         break;
      private function _onImageSelect( evt : Event ):void
       _fileRef.load( );
       _fileRef.addEventListener(Event.COMPLETE, _onDataLoaded);
       _browseTxt.text = String(evt.target.name);
      private function _onDataLoaded(evt:Event ):void
       var tempFileRef:FileReference = FileReference(evt.target);
       _loader = new Loader( ) ;
       _loader.contentLoaderInfo.addEventListener( Event.COMPLETE, _onImageLoaded );
       _loader.loadBytes( tempFileRef.data );
      private function _onImageLoaded(evt:Event ):void
       _bitmap = MovieClip(evt.target.content);
       _bitmap.smoothing = true;
       _bitmap.x = 5;
       _bitmap.y = _browseTxt.y + _browseTxt.height + 5;
       addChild( _bitmap );
       if (_bitmap.width > _MAX_WIDTH || _bitmap.height > _MAX_HEIGHT)
        _resizeBitmap( _bitmap );
      private function _resizeBitmap( target : MovieClip ):void
       if (target.height > target.width)
        target.width = _MAX_WIDTH;
        target.scaleY = target.scaleX;
       else if (target.width >= target.height )
        target.height = _MAX_HEIGHT;
        target.scaleX = target.scaleY;

    I'm confused. It looks like you're placing everything through ActionScript, so it would seem you don't really have a timeline involved. If you do have a timeline involved that's not reflected in your code, have you tried gotoAndPlay(someFrame)? I don't see anything like that in your code.

Maybe you are looking for