-
1. Re: Complex nested MovieClips
Ned Murphy Aug 5, 2010 2:44 PM (in response to Shed Simas)Are you sure that line is the one with the error? If you go into your Flash Publish Settings and enable the option to Permit Debugging, the error message should include a line number after the first frame number listed.
-
2. Re: Complex nested MovieClips
Shed Simas Aug 6, 2010 4:20 PM (in response to Ned Murphy)Hi Ned,
Thank you for replying. Flash actually crashed on me yesterday when I tried using Permit Debugging, and when I got to re-coding that specific section today it worked out just fine. Not sure what the problem was!
However, I'm still having issues. I'm trying to use the same code on another date on the calendar, and I'm now getting the following error:
1119: Access of possibly undefined property july17th through a reference with static type flash.display:SimpleButton.
-
3. Re: Complex nested MovieClips
Ned Murphy Aug 6, 2010 4:38 PM (in response to Shed Simas)What code do you have that involves something to do with july17th?
-
4. Re: Complex nested MovieClips
Shed Simas Aug 6, 2010 5:04 PM (in response to Ned Murphy)That's strange. I was sure I'd posted the code! My bad. Here it is:
july.july17th.addEventListener(MouseEvent.CLICK, showSummerOpenHouse);
That's one of the lines that's giving me trouble. "july" is the name of the MovieClip that contains the month of July, and "july17" is the name of the button that links to the event descriptions for that date. The error message only refers to this line, so I'm assuming there are no problems with the function.
I went ahead and coded the rest of the calendar, and the months of May, June and July don't work, while April, August and October do (there are no events during the other months, yet). The EventListener code follows the same format on all months, as do the structures of the months.
Thanks.
-
5. Re: Complex nested MovieClips
Ned Murphy Aug 6, 2010 5:39 PM (in response to Shed Simas)Check the instance name of the button on the stage. You just mentioned its name is " july17 " but your code targets " july17th "
I'm curious.... do you have 365 manually planted/coded buttons in this calendar?
-
6. Re: Complex nested MovieClips
Shed Simas Aug 6, 2010 6:06 PM (in response to Ned Murphy)Sorry, I had it named "july17" before, and changed it to "july17th" because "july17" is already the name of the target frame in calendarContent. I wasn't sure whether it would make a difference. The code and instance both say "july17th"; the problem must be somewhere else...
I do have all the events manually coded, but it's actually only about 15 events. There's only 2-3 events per month, and only for the months of April to October. I'm fairly new to Flash and didn't know how else to do it.
-
7. Re: Complex nested MovieClips
Ned Murphy Aug 6, 2010 7:00 PM (in response to Shed Simas)I can duplicate that error if I create if I take july and turn it into a button symbol. I suspect that you have somehow done that.
If you made july as a button symbol, button symbols are limited to the properties Flash provides for them and you cannot add others and target them with code, such as objects inside with instance names, ... only MovieClip symbols can have dynamic/targetable content/properties added to them.
I won't criticize your design approach... devising a solution that you can understand is good stuff, and with the limited number of events you need to deal with, it isn't a bad choice. As you learn more Actionscript, you will discover other ways to approach a design that can make for less work and more dynamic functionality.
-
8. Re: Complex nested MovieClips
Shed Simas Aug 9, 2010 1:57 PM (in response to Ned Murphy)Hi Ned,
Unfortunately, the months that are not working were all created as MovieClip symbols, just like the ones that work. I even went into the months and converted the contents into a new symbol and substituted the original; still nothing. Finally, I duplicated one of the working months, substituted the content, and it still gave me the same error.
EDIT: So over the weekend I learned how to use event.target functions, and today after trying the solutions above I went through my calendar code and simplified it with those functions. In the process, I also had to change some frame labels and instance names. Just to see if it made a difference, I substituted the faulty functions with the event.target ones, and somehow they are now all working perfectly. Thank you for all your help.Message was edited by: Shed Simas
-
9. Re: Complex nested MovieClips
Ned Murphy Aug 9, 2010 2:07 PM (in response to Shed Simas)You're welcome. Too often, when it comes to Flash, persistence is the key to solving most anything. It's good that you stuck to your guns and kept up the battle.


