Flash/Actionscript Question

thumb03.onRelease = function(){
 image_holder.loadMovie("images/03.jpg");
 submenu01_holder.attachMovie( "submenu01", "submenu01_new",this.getNextHighestDepth());
 getURL("./htm/03.html", "tracker");
};

So I'm working on a template portfolio from isacc oster and I'm trying to load an image with a submenu on top of it that will let you click through a couple different related images. However, right now the submenu keeps loading underneath the image, so the buttons are there and the you can see it a split second before the other image loads over the top. I tried manually putting in levels for the image and submenu and no luck. Can anyone help me out?

Replies

  • Eric Chadwick
  • NoChance
    That's funny I could have sworn I asked how to fix something in flash, not for unwanted opinions, next time I'll be more specific.
  • Eric Chadwick
    Heheh, don't get your panties in a bunch. I meant it as a constructive criticism, since using Flash for a portfolio is generally a bad idea. But you're certainly welcome to ignore my post, it's ultimately your decision as to what goes in your site.
  • Krypteia
    submenu01_holder.attachMovie( "submenu01", "submenu01_new",this.getNextHighestDepth());


    Instead of "this.getNextHighestDepth()", have you tried using 1 (or any number other than 0)?


    Or, have you tried attaching the sub menu movie clip to the image holder (image_holder) instead of the separate sub menu holder - and then setting the depth of the sub menu to 1 [or whatever the depth above the image]?

    Maybe something like:

    thumb03.onRelease = function(){
    image_holder.loadMovie("images/03.jpg");
    image_holder.attachMovie("submenu01", "submenu01_new", 1);
    getURL("./htm/03.html", "tracker");
    };

    .... or something along those lines?

    Here's a Flash Help on attachMovie():

    http://www.adobe.com/livedocs/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000860.html
  • Richard Kain
    Offline / Send Message
    Richard Kain polycounter lvl 12
    Awww man, that is some old-ass Actionscript 2.0. I don't touch that stuff anymore if I can help it. AS3 or bust.
  • Krypteia
    Alright, I got it working on my end in a quick example file.

    Ignore this if you know it already:

    - The movie clip that's going to be attached (if it's being loaded from the library) needs to be exported for Actionscript via it's properties. When you click the box that says "Export for Actionscript" you'll also need to add a name for it to be identified by in the "Identifier" field. Whatever goes in that box will be what you use to call that movie clip - and what you put in the first part of the attachMovie function [where "submenu01" is]. And of double check that you have instance names for your movie clips on the stage.

    - The code works with both a number or the getNextHighestDepth() function.

    - Try attaching it to the image_holder itself (in your code). That may have been the problem all along actually - because my attachMovie code looks like yours.

    Here's my FLA:

    http://drop.io/attachMovieTest
  • NoChance
    Aha! I couldn't figure out why the depths weren't working correctly even when inputter manually but I figured out a workaround by adding this line of code

    image_holder.swapDepths(submenu01_holder);

    So, now I don't really need to figure out why the depths weren't working correctly I can just swap them. Thanks for those who helped
  • renderhjs
    Offline / Send Message
    renderhjs polycounter lvl 9
    not that it matters now, but you should upgrade at some point to as3 as Actionscript 1 or 2 (more or less the same) is not thought anywhere anymore these days.
    I used to do a crazy lot with Actionscript 1 and 2 before for more than 10 years but I can't do it straight out of my head anymore because it is as3 these days all the time.

    If you have some spare time you might consider adding a XML file for the content of the galleries. Using a XML you can define within the XML file what should be within the gallery and how much and with which names etc. That way you don't need to open up Flash to edit the source but instead just edit the XML file within notepad or any other simple text editor.

    A XML could for example look like this:
    [php]<gallery>
    <section title="Game Art">
    <img name="boobs and guns" url="../img/image05.jpg">
    <img name="Orc with a toy" url="../img/image02.jpg">
    </section>
    <section title="Concept Paintings">
    <img name="Screwer" url="../img/image03.jpg">
    <img name="Thongs" url="../img/image01.jpg">
    <img name="Chicken" url="../img/image00.jpg">
    </section>
    </gallery>[/php]
    It is easy to read and edit, and thus a bigger guarantee for being able to update the portfolio should you do some changes in the future.
    Google around for xml gallery on the net if you are interested in that kind of stuff.
Sign In or Register to comment.