1

I'm writing a calendar in AS3. I'm having a problem when I try access the object(days of the month) names. Code below:

var tempDayName:String = "day"+dd.toString();
Calendar.tempDayName.gotoAndStop(2);

So this happens from 1 - 31 for each day of the month. "dd" is and int from 1 - 31. Manually it works:

Calendar.day1.gotoAndStop(2);

But I want to put it in a for loop.

Any help please?

Best Regards Luben

--EDIT--

The same does NOT work for Dynamic text does not work...

NewsMC["News"+1].text = NewsLoadedData[0].articleText;

Does anybody have any idea how to do the following:

NewsMC.News1.text = NewsLoadedData[0].articleText; NewsMC.News2.text = NewsLoadedData[1].articleText;

Cheers Luben

1 Answer 1

2

Actionscript object are also arrays

you can test this Calendar["day" + i].gotoAndStop(2);

Sign up to request clarification or add additional context in comments.

2 Comments

To clarify: Calendar.day1 is the same as Calendar["day" + 1]
HOWEVER!!! The same does not work for Dynamic text does not work... NewsMC["News"+1].text = NewsLoadedData[0].articleText; NewsMC.News1.text = NewsLoadedData[0].articleText; NewsMC.News2.text = NewsLoadedData[1].articleText;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.