Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 590455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:31:53+00:00 2026-05-13T15:31:53+00:00

It think Flash is telling me that my array tabData is getting duplicated, but

  • 0

It think Flash is telling me that my array tabData is getting duplicated, but I only set it up once in the var section of my code:

This is the line with the error:

for (var i in tabData) {

TabMenu class

private var tabData:Array = []; // <- tabData created here

public function drawTabMenu(w, h, color, videoHDiff, ypos):void
    {           
        trace("drawTabMenu --------------");

        for (var i in Global.xml..tab) {
            tabData.push( {id:Global.xml..tab[i].@id, video:Global.xml..tab[i].vid} );
        }

        // DRAW GRAPHICS CODE HERE...

        //draw the tabs
        for (var i in tabData) { // < line throwing error

            var tab:MovieClip = new TabDefault();
            var active:MovieClip = new TabActive();
            tabArray.push(tab);
            tab.video = tabData[i].video;
            tab.addChild(active);
            i < 1 ? active.visible = true : active.visible = false;
            tab.y = topShadow.y + 5;

            // add in the textfield here
            // addChild(tf);

            // resize the tab background to textfield
            tab.x = i < 1 ? 10 : tabArray[(i-1)].x + (tabArray[(i-1)].width+3);
            tab.active = i < 1 ? tab.active = true : tab.active = false;
            topShadow.addChild(tab);

            tab.mouseChildren = false;
            tab.buttonMode = true;
            tab.addEventListener(MouseEvent.CLICK, tabClick);
        }

        // set default thumbnails here
        trace("FIRST TAB DATA: "+tabData[0].video);
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:31:53+00:00Added an answer on May 13, 2026 at 3:31 pm

    I don’t know flash, but is the fact that you use i as the loop variable in both loops a problem? I think it shouldn’t be – certainly wouldn’t be in Java – but maybe that’s it.

    Also, unrelated to your problem, this line:

    tab.active = i < 1 ? tab.active = true : tab.active = false;
    

    would be easier to read like this:

    tab.active = i < 1;
    

    Again, assuming flash works like languages I know better.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.