A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: MovieClip Depth Weirdly Changing

  1. #1
    Senior Member gilgaMExe's Avatar
    Join Date
    May 2003
    Posts
    163

    MovieClip Depth Weirdly Changing

    Click on the link in my signature, then click OK in the SWF presenting up, then MAKE A MAP, then OK again, then draw some map blocks after pressing 1, 2 or 3 in example.

    Then press I, you will go to the instructions screen.

    OK, now you click on DONE and when you come back the DEPTH of MOUSEBLOCKCURSOR and MOUSEBLOCK will be set to -16381 and -16379.

    Fact is that every time you enter in the BUILDMAP the swapdepth is made and I put the blocks at 10001 and 10002.

    What's happening?
    HEXTRATEGY - Coming August 2003 (I hope)

  2. #2
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Make a variable in the beginning:
    _root.infovisible=0;
    now when user presses I add
    _root.infovisible=1;
    and when info is closed
    _root.infovisible=0;

    Now in the actions for your mouseblocks and swapdepths and stuff, put it all inside condition:

    if(_root.infovisible==0){
    ...
    }

    Hope it helped

  3. #3
    Senior Member gilgaMExe's Avatar
    Join Date
    May 2003
    Posts
    163
    No, sorry, mate, because I forgot to tell you that when you press I you are going to another frame where are the instructions and the button to get back to the frame to build map.

    When you press I first time I remove all blocks, then when you click DONE I get back to the frame where the map is built.

    What I don't understand is why repeating the same action in the frame the depths change...

    When I remove the instances of the map the depths should free too, isn't it?

    So when I get back to that frame nothing shold have changed... what hell is that number -16xxx???
    HEXTRATEGY - Coming August 2003 (I hope)

  4. #4
    Senior Member gilgaMExe's Avatar
    Join Date
    May 2003
    Posts
    163
    Done.

    The problem was in the second entering in the building map frame: I was setting the depth of the mouseblock from inside the mouseblock pointing at itself this way:
    code:
    _root.mouseblock._x = _root._xmouse;


    I replaced with
    code:
    this._x = _root._xmouse;



    I think this thing was making Flash a bit crazy is it possible?
    HEXTRATEGY - Coming August 2003 (I hope)

  5. #5
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    I know you've solved your problem but this may prove helpful:

    There's a major bug in Flash ( MM say it's a "feature" ) involving swapDepths() and author time content.
    If you place a mc on the stage and then use swapDepths on it and then loop back to the frame it was first placed on the stage you'll end up with a duplicate copy.

    The weird depths you were reporting show the mc is author time content ( depths show up as between -1 and -16383 ) rather than dynamic content.

    Squize.

  6. #6
    Senior Member gilgaMExe's Avatar
    Join Date
    May 2003
    Posts
    163
    LOL so here it is!!!

    Thank you very much... I knew that the old code it should have been good anyway!
    HEXTRATEGY - Coming August 2003 (I hope)

  7. #7
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    No worries, I've wasted days and ripped out so much good code because of that "feature"

    It's one of those strange quirks of Flash that is very difficult to find out any info about.

    Squize.

  8. #8
    Senior Member gilgaMExe's Avatar
    Join Date
    May 2003
    Posts
    163
    Yes, already the system is much particular to program for my tastes... if there are also these hidden bugs the thing becomes really heavy :|
    HEXTRATEGY - Coming August 2003 (I hope)

  9. #9
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    Flash isn't really that buggy, just got some quirks here and there

    The swapDepths one is strange, 'cause finding anything out about it was really difficult ( MM haven't even published a white paper, and have no plans to ) so I thought it was just me being stupid.

    99% of the quirks are really well documented with workarounds.

    Squize.

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