A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: [RESOLVED] removing a dynamic scrollpane

  1. #1
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389

    resolved [RESOLVED] removing a dynamic scrollpane

    Hi,

    how do you remove a scrollpane created dynamically?

    I have tried a couple of ways but can't find any examples on the net.

    Code:
    this.createObject("ScrollPane", "cspScrollPane", this.getNextHighestDepth());
    
    this.destroyObject("cspScrollPane");
    will not work and adding a listener like the one example in flash 8 won't either.

    I know you could create it inside a empty clip and then get rid of the clip, but I'd like to know if there's a way for the sake of learning.

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    PHP Code:
    attachMovie("ScrollPane""cspScrollPane"_root.getNextHighestDepth());

    removeMovieClip("cspScrollPane");
    // or removeMovieClip(cspScrollPane); 

  3. #3
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389
    thanks, but it's not a clip I'm mentioning. I'ts a component.

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,
    PHP Code:
    this.createObject("ScrollPane""cspScrollPane"this.getNextHighestDepth());

    destroyObject("cspScrollPane"); 

  5. #5
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389
    it doesn´t work for me

  6. #6
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Do you have a scrollpane component in your library, if not, drag one to the stage and then delete it.
    Perhaps attach your fla if you have no success
    Last edited by fruitbeard; 12-15-2012 at 11:09 AM.

  7. #7
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389
    hi,

    done the same as you in the code and have a scrollpane component in the library. Have also tried to follow the commented out example replacing ("my_ti") with my component's instance nAttachment 73983ame and no luck either.

  8. #8
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    You need to publish for Flash player 9 minimum. Then Hey Presto.

  9. #9
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389
    Hi again,

    There's got to be a way in Flash 8. Can't publish to player 9

  10. #10
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Oddly enough it works if you publish for flash player 6 or 9 and above, but not for 7 and 8. Bizare.

  11. #11
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389
    I'll try it on 6, thanks for the help

  12. #12
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389

    Solved destroying object

    hi, Fruitbeard,

    I managed to find a way to destroy the component object publishing in flash player 8. Like so (if you're interested):

    Code:
    this.createEmptyMovieClip("scrollPaneContainer", this.getNextHighestDepth());
    this.scrollPaneContainer.createClassObject(mx.containers.ScrollPane, "cspScrollPane", 20);
    scrollPaneContainer.cspScrollPane.setSize(680, 560);
    scrollPaneContainer.cspScrollPane.contentPath = "image";
    
    button_btn.onRelease = function():Void {
    	scrollPaneContainer.destroyObject("cspScrollPane");
    }
    but I find myself with a final problem before beeing able to finish my page. When the component is in the library, this scripted menu I have based on (http://flashexplained.com/menus-inte...rop-down-menu/) freezes when rolling the mouse out. I was wondering if you might have any idea why this could happen... I don't know much about developing, never really used debugging so I wouldn't know what to look for, but it shows a focusmanager variable or object that made me think whether I should keep trying to read about it or try building my own scroll pane with a mask or somehow. Do you have any idea about if changing the focus could make any difference?

    thanks

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