dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Scroll Pane and Attaching Movie Clips Inside it

  1. #1
    swfBB Developer
    Join Date
    Oct 2000
    Posts
    239

    Scroll Pane and Attaching Movie Clips Inside it - A Solution

    Hi Guys. Does anyone know how to do this as its doing my head in

    I have a scroll pane which is called 'mypane' on the main timeline. I then have a movie clip called mymc which I want to duplicate 5 times into the scroll pane and have it scroll vertically.

    I can duplicate the mc's fine normally but cant seem to get them to duplicate inside the scroll pane and then allow it to scroll through them.

    Can anyone offer some help?

    Thanks.
    Last edited by Immulsifier; 10-16-2002 at 06:47 PM.

  2. #2
    Senior Member
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    1,749

    Duplication is duplication.

    The code is identical wherever you do the duplication, the thing is you can't specify a target path with duplicate so you have to make sure the original is in place first.

    However, attachMovie DOES allow you to specify target paths and is many ways much more flexible.

  3. #3
    Senior Member
    Join Date
    Aug 2000
    Location
    Desert Southwest
    Posts
    367
    How are you duplicating the MCs?

    In your library, in the specific mc(s) under linkage do you have the options, "export for actionscript" and "export in first frame" selected? Also, did you enter a name in the identifier field?

  4. #4
    swfBB Developer
    Join Date
    Oct 2000
    Posts
    239
    Yes I have no problem duplicating the movieclips normally either using attachmovie or duplicatemovieclip. My problem is that I cannot get them to duplicate or attach inside the scroll pane.

    Anyone have any code that will do this or anyone have any experience of it?

  5. #5
    swfBB Developer
    Join Date
    Oct 2000
    Posts
    239
    Thanks for the help guys but I now have this working using a bit of code I stumbled across on the MM site. I have a test FLA with the scrollpane fully functional scrolling dynamically attached movie clips if anyone is interested. Give me a shout and I will upload it if anyone else wants to see how I did it

    Immy

  6. #6
    Senior Member
    Join Date
    Aug 2000
    Location
    Desert Southwest
    Posts
    367
    Originally posted by Immulsifier
    ......if anyone is interested. Give me a shout and I will upload it if anyone else wants to see how I did it

    Immy


    Glad you got it working. I have been trying to figure out how to do it and would be curious to see the fla -- if you don't mind.

    Thanks.

  7. #7
    swfBB Developer
    Join Date
    Oct 2000
    Posts
    239
    Ok I have uploaded the file to http://www.btinternet.com/~phillip.v...scrollpane.zip

    Here is a basic explanation of how it works.

    There is a Movie Clip in the library which contains 2 text fields which are there to demonstrate the scroller. They are named field1 and field2. The Movie Clip is set up to export for actionscript in the first frame and is given the name 'clip'.

    Look in the first frame of the main timeline and you will see this is where it all happens. Firstly a blank movie clip is created called 'myscroll' which in the end is what will be scrolled. The next section of the code gets the 'clip' movie from the library and attaches it to the blank clip which we just created. It is attached 20 times with the y coordinate increasing by 10 pixels each time so they all appear like a vertical list. While attaching the movieclip, the text fields are filled with text "Field1" and "Field2" to demonstrate the scroller.

    So at this point we have a movieclip called 'myscroll' which is not visible on the stage with 20 movieclips attached to it. The final line tells the scrollpane what it is scrolling where 'myscollpane' is the instance name for the scrollpane itself.

    Thats about it Remember if you test the movie from within the MX authoring environment the text will not be masked by the scrollpane. You will need to publish it for it to work to its full extent

    I cant take the credit for this as it was inspired by some code on the MM site as I said

    Immy

  8. #8
    Senior Member
    Join Date
    Aug 2000
    Location
    Desert Southwest
    Posts
    367
    Makes sense! Thank you very much.

    Cheers!

  9. #9
    swfBB Developer
    Join Date
    Oct 2000
    Posts
    239
    top

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