A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: dynamically attached overlapping buttons & depth

Hybrid View

  1. #1
    Junior Member
    Join Date
    Mar 2006
    Posts
    21

    dynamically attached overlapping buttons & depth

    Hi, hope i can get some help on this i've been trying for ages with many different styles of code and not found the perfect answer yet.

    I have a map where people can add cities to, the values for each city is stored in a db. each city is represented by a red dot on the map and on a roll over event it displays a text label of the city name. The cities are all attached dynamically. This is all working fine. Currently I am using a swapdepths(10000000) method on the rollover for each button which is working fine on the first view the page, however upon adding a new city some of the cities are very close to each other (eg New York, Boston, Philly) and on the rollover some citiy labels are displaying above or blow the other city dots near them.

    Difficult to explain - much easier to understand visually. url below
    http://www.joeshields.net/flashlab/cityviewmax/

    Any help would be appreciated.

    thanks

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi,

    If your problem has to do with the depths - and you want to guaratee that the next movie clip appears on top of the previous:
    1- in MX 2004 or later, you can use getNextHighestDepth().
    code:

    some_mc.swapDepths(this.getNextHighestDepth());



    2 - In previous versions, you keep record of depths:
    code:

    var depth = 1;
    some_mc.swapDepths(++depth);


    I'm moving this thread to the ActionScript forum as it seems to belong.

  3. #3
    Junior Member
    Join Date
    Mar 2006
    Posts
    21
    thanks that put me on the right path, i was actually adding my dynamic mc's inside another movie so I set it to swapDepths(containerMC.GetNextHighestDepth()).

    Cheers

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