A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [RESOLVED] Scrolling Movie Clips

  1. #1
    Member
    Join Date
    Oct 2007
    Posts
    30

    resolved [RESOLVED] Scrolling Movie Clips

    I have spent several hours trying to figure out how to scroll a movie clip in As3/ Cs3. I haven't had any luck in finding any tutorial or a full explanation on how to do it. I can only find out how to do it on Flash 8 or in As2. I am a pretty big noob with the idea. I know that you can either use a component like the Scrollpane, but I can't even get that to work. As well I know there is a way to write action script and masking to achieve the same affect. All I trying to do is scroll a movieclip which has text and several graphics and buttons on it.
    If you have any links to tutorials help me out here. - Thanks.

  2. #2
    Multitouch Aficionado
    Join Date
    Mar 2006
    Posts
    275
    1) Make a Sprite to hold everything you want in the ScrollPane.
    2) Put a ScrollPane on the Stage, and give it an instance name.
    3) Add this ActionScript:

    myScrollPaneNameGoesHere.source = theSpriteIMadeToHoldMyStuff;

    If you want to make the holding graphic in CS3 as a Symbol, go into the Symbol properties and click Export for ActionScript. There should be a name in the Linkage box. Make note of it, and use this ActionScript instead:

    Code:
    var stuffIWantScrolled = new putTheLinkageNameHere();
    myScrollPaneNameGoesHere.source = stuffIWantScrolled;

    I'm sure someone asked the exact same question the other day. . .

  3. #3
    Member
    Join Date
    Oct 2007
    Posts
    30
    Hey thanks for the reply. Ill take a look at it when I get home and see if I can get it to work. Sorry if it has already been posted I did several searches. I probably didn't have the right keywords.

  4. #4
    Member
    Join Date
    Oct 2007
    Posts
    30
    Still need help.

    I don't know how to make a sprite, so I decided I would make the holding graphic in Cs3 as a symbol. I used the other action script as well. What is is doing is there is a scrollbar now, but it is not scrolling the graphic. As well you can still see the text that should be revealed by scrolling down. I am really lost now. I think I need to mask the bottom of the text... I think? I am not sure at all.

  5. #5
    Multitouch Aficionado
    Join Date
    Mar 2006
    Posts
    275
    Let's say your Class name (from the Linkage box) is Fred. To add a copy (we call them instances) of Fred to the Stage, you would use this code:

    Code:
    var fred = new Fred(); //Make a new copy of Fred and call it fred
    addChild(fred); // Tell the computer to take fred and add it to the Stage
    When you hit Test Movie, fred should appear in the top left corner of the Stage. Since you want fred to be inside a ScrollPane, you do this instead: (I'm assuming scrollPane is the name you gave the ScrollPane that you dragged onto the Stage. You can assign names in the Properties panel)

    Code:
    var fred = new Fred(); //Make a new copy of Fred and call it fred
    scrollPane.source = fred; //Put fred inside the ScrollPane instance scrollPane that you dragged onto the Stage

  6. #6
    Member
    Join Date
    Oct 2007
    Posts
    30

    [RESOLVED] Scrolling Movie Clips

    Thanks! I figured it out after I realized that the Scrollpane was a whole window and not just the scrolly thingy. What I was doing was having a textbox plus a Scrollpane on the side thinking that would scroll it up and down. I feel like a huge noob now, but oh well! Thanks for your help illustratedlife!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center