A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Dynamic Menu Bar, spacing between tabs, Need Help!

  1. #1
    Senior Member
    Join Date
    Jan 2001
    Location
    Barcelona
    Posts
    129

    Dynamic Menu Bar, spacing between tabs, Need Help!

    Hello dear Flash community,

    I developed a dynamic menu bar in Flash that loads the text from an Array and in order to the number of tiles it duplicates the tabs using “duplicateMovieClip” and each tab automatically resize to the width of the title. Till here everything works fine.

    “YOU CAN SEE AND DOWNLOAD THE EXAMPLE HERE”

    The problem starts when Flash tries to sort the tabs dynamically whit the same offset space in between them… I think that the code should be correct and I don’t understand why the distance ends up so messy!

    I’m better in designing that coding and I lost a lot of hours trying to find out where the problem is! Please help me out on this, I’M STUCK

    “YOU CAN SEE AND DOWNLOAD THE EXAMPLE HERE”

    Thanks for your help. (Of course you can use the example for your own interests)

  2. #2
    Senior Member
    Join Date
    Jan 2001
    Location
    Barcelona
    Posts
    129

  3. #3
    Senior Member
    Join Date
    Jan 2001
    Location
    Barcelona
    Posts
    129
    Please, please, please, help me out on this...

  4. #4
    Senior Member
    Join Date
    Jan 2001
    Location
    Barcelona
    Posts
    129
    Please, don't leave me in darkness...

  5. #5
    ASs 2.0
    Join Date
    Feb 2003
    Location
    Istanbul / Turkey
    Posts
    140
    same problem here....

    did search and found this thread... didn't open a new one cause getting any answers is hard...

    any suggestions?

  6. #6
    :
    Join Date
    Dec 2002
    Posts
    3,518
    symbolica,
    The older links didn't work. Can you most an example or sample of what you are specifically trying to do? (If you post files, I only have MX2004 and can't open anything newer.)

  7. #7
    ASs 2.0
    Join Date
    Feb 2003
    Location
    Istanbul / Turkey
    Posts
    140
    Hi dawsonk,

    first of all thank you for replying fast(as always =))

    actually no need for files cause i'll also put the code here...

    i have links from XML file like this,

    TEAM CORPORATE PRESSKIT

    let's say,
    TEAM = 12 px wide,
    CORPORATE = 24 px wide,
    PRESSKIT = 20 px wide,


    all of them are placed into textboxes that are placed inside a movieClip which is duplicated in numbers of the links with a for loop...

    the problem is... if there is a constant width for each text link placed inside duplicated clips, it would be easy like,

    spacer*i,

    where spacer = text width(for a constant value),

    but since as you see the text links varies in width, i can't find a way to place(_x) them properly without overlapping or having meaningless and different gaps between 'em...

    i also used autoSize = true, wordWrap = false properties for the textField... but no luck... also tried textWidth...

    to sum it up, how can i pass the width value of the textField to its container movieclip?? and how can i use this data effectively?

    I hope it's clear because I have CS3 and no files will be available for you as you mentioned too...

  8. #8
    ASs 2.0
    Join Date
    Feb 2003
    Location
    Istanbul / Turkey
    Posts
    140
    and here is the piece of code... that duplicates the link container mc's... as you can see the commented lines, i tried different ways without luck...

    PHP Code:
    for (var sl 0sl<sublinks.lengthsl++){
            
                
                
    sLinkHolder sublinkBox.duplicateMovieClip("sb"+slsl);
                
                
    sLinkHolder.sublink.wordWrap false;
                
    sLinkHolder.sublink.multiline false;
                
    sLinkHolder.sublink.autoSize "left";
                
                
    sLinkHolder._x = (sLinkHolder._width+10)*sl;
                
    //names = sLinkHolder._name;
                
    trace(sLinkHolder._width);
                
                
    //setProperty(sLinkHolder, _width, sLinkHolder.sublink._width);
                
                //sLinkHolder._width = sLinkHolder.sublink.textWidth;
                //sLinkHolder._x = sLinkHolder._width * sl;
                
                //trace(sublinks[sl].firstChild.nodeValue);
                
    sLinkHolder.sublink.htmlText sublinks[sl].firstChild.nodeValue;
                        
                
        } 

  9. #9
    ASs 2.0
    Join Date
    Feb 2003
    Location
    Istanbul / Turkey
    Posts
    140
    http://board.flashkit.com/board/show...mic+text+width

    just found another similar thread but without the exact or right answer...

  10. #10
    ASs 2.0
    Join Date
    Feb 2003
    Location
    Istanbul / Turkey
    Posts
    140
    btw...

    assigning text width to its container mc is possible and ok i think... the problem is how can i place those mcs(duplicated) end to end?

  11. #11
    :
    Join Date
    Dec 2002
    Posts
    3,518

    Maybe try something like this...

    Code:
    baseX = sublinkBox._x;
    //
    for (var sl = 0; sl < sublinks.length; sl++) {
    	sLinkHolder = sublinkBox.duplicateMovieClip("sb" + sl, sl);
    	sLinkHolder.sublink.wordWrap = false;
    	sLinkHolder.sublink.multiline = false;
    	sLinkHolder.sublink.autoSize = "left";
    	sLinkHolder.sublink.htmlText = sublinks[sl].firstChild.nodeValue;
    	sLinkHolder._x = baseX;
    	baseX += (sLinkHolder._width + 10);
    }

  12. #12
    ASs 2.0
    Join Date
    Feb 2003
    Location
    Istanbul / Turkey
    Posts
    140
    arrrgggghhhhhh!!!! damn me.

    thanks a lot... really...

    sometimes ppl get stuck in the same circle for hours without seeing the answer nearby...

    that was a quick and successful way and worked perfectly... funny i couldn't figure it out...

    thanks a lot again

    PS : i asked this before... how can i put a [RESOLVED] mark in front of the threads that come into successful conclusion(cause i can't edit the thread after some amount of time)? not this one maybe but mines. To keep the board cleaner and more useful...

  13. #13
    :
    Join Date
    Dec 2002
    Posts
    3,518
    At the top of the thread is a drop down menu for Thread tools, select the resolved option.

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