A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Any help with the UI?

  1. #1
    Junior Member
    Join Date
    Apr 2002
    Posts
    12
    Hope this makes sense. I’m playing with the draggable pane in the second UI group. I just want to have three buttons that “pop” up different panes with different content in each. You have to “attachMovie” to do this. You also have to make the name and depth of you new pain…I mean pane dynamically created. This way if the user selects the same button twice your program doesn’t freak out. This has all worked fine using action script, except for one thing. To put the content in the pane you need to call a method named .setScrollContent. For some reason the name of object that you send the method to can’t be a variable.

    Here’s the code:
    on (release) {
    _root.nextl++;
    _root.attachMovie("FDraggablePaneSymbol", "pano"+_root.nextl, _root.nextl);
    setProperty("_root.pano"+_root.nextl, _x, "468");
    setProperty("_root.pano"+_root.nextl, _y, "70");
    “_root.pano”+_root.nextl.setScrollContent("tes ting");
    }

    Everything works but putting in the content.
    Any help out there on why and what I can do

  2. #2
    President, save the
    New Zealand dollar foundation

    Join Date
    Jun 2000
    Posts
    1,743
    with a slight adjustment it should work:
    Code:
    on (release) { 
        _root.nextl++; 
        _root.attachMovie("FDraggablePaneSymbol", "pano"+_root.nextl, _root.nextl); 
        _root["pano"+_root.nextl]._x = 468; 
        _root["pano"+_root.nextl]._y = 70; 
        _root["pano"+_root.nextl].setScrollContent("testing"); 
    }

  3. #3
    Junior Member
    Join Date
    Apr 2002
    Posts
    12

    thanks

    Thanks, works like a charm.
    You're freaking awsome!

    Gotta say this is the best board out there!

  4. #4
    President, save the
    New Zealand dollar foundation

    Join Date
    Jun 2000
    Posts
    1,743
    no worries.
    as a side note, out of interest,
    the reason I wrote it the way above, rather than using "with" like this:
    Code:
    on (release) { 
        _root.nextl++; 
        _root.attachMovie("FDraggablePaneSymbol", "pano"+_root.nextl, _root.nextl);
        with (_root["pano"+_root.nextl]) {
            _x = 468; 
            _y = 70; 
            setScrollContent("testing");
        }
    }
    is because of a problem I have had in getting certain methods to work within a "with" handler. From my experience, the above would work when setting the X and Y, but not for the setScrollContent().
    It might be that it does work, I haven't tested the setScrollContent() to see whether or not it does.
    I must add that I haven't done any testing or documenting what will work and what won't, and most of this is based on Flash 5 stuff I did last year (should be the same behaviour in Flash MX though).
    I have just found that certain method calls just don't happen when placed within a "with" handler.
    I have found myself on quite a few occasions setting numerous properties and variables using a "with", closing the braces, and right below it having to code in the full target to call a method.
    Seems crazy.
    Be interested to know if anyone else has duplicated this behaviour??

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