-
1. Re: Button does not work
kglad Aug 21, 2009 11:27 AM (in response to TLCMediaDesign)is playMovie() called when more_btn is clicked?
-
2. Re: Button does not work
Nalinda Bandara Aug 21, 2009 11:47 AM (in response to TLCMediaDesign)didn't you add a stop() action at the 2nd frame?
or u can use gotoAndStop(2) for play()
-
3. Re: Button does not work
TLCMediaDesign Aug 24, 2009 5:29 AM (in response to Nalinda Bandara)The playMovie function should be called when the "more" button is clicked in this statement:
more_btn.addEventListener(MouseEvent.CLICK, playMovie);
There are only two frames in the movie and there is a stop() on both frames.
I built a movie with two frames and just the more button and the code in my original post. The movie toggles between frame 1 and 2. When I put the button and code in the template I used it stops working. The template has most of the code in class files.
-
4. Re: Button does not work
kglad Aug 24, 2009 7:13 AM (in response to TLCMediaDesign)use the trace() function to see if playFunction() is called.
-
5. Re: Button does not work
TLCMediaDesign Aug 24, 2009 7:17 AM (in response to kglad)It's getting called in the simple version, not in the video template version.
-
6. Re: Button does not work
kglad Aug 24, 2009 8:01 AM (in response to TLCMediaDesign)1. is the template published for as3?
2. is more_btn on its own layer with only its initial keyframe and no other keyframes?
-
-
8. Re: Button does not work
kglad Aug 24, 2009 8:49 AM (in response to TLCMediaDesign)then either,
1. trace() is disabled (put a trace("HI") on frame 1 of the main timeline to confirm) or,
2. the template contains another object named more_btn
-
9. Re: Button does not work
TLCMediaDesign Aug 24, 2009 10:22 AM (in response to kglad)Trace is working and there are no other buttons with that name. I'll post the files if that would help?
-
10. Re: Button does not work
kglad Aug 24, 2009 10:33 AM (in response to TLCMediaDesign)attaching your fla would help if someone downloads and corrects it. i don't usually do that unless i'm hired to fix the problem. but someone else might do that for you.
-
11. Re: Button does not work
TLCMediaDesign Aug 24, 2009 11:55 AM (in response to kglad)I finally got it to work. I moved the line that is bolded from the bottom to where it's showing now.
stop();
more_btn.addEventListener(MouseEvent.CLICK, playMovie);
flvDisplay.stop();
//set all buttons to invisible
//buttons are turned on in .as file according to available videos
var allBtns:*;
for(var i:uint=0; i<20; i++)
{
// Initialize section buttons
allBtns = getChildByName("section_"+(i+1));
allBtns.visible = false;
}
function playMovie(event:MouseEvent):void
{
if (currentFrame == 1 ){
play();
}
else
{
gotoAndStop(1);
}
} -
12. Re: Button does not work
kglad Aug 24, 2009 12:01 PM (in response to TLCMediaDesign)that wouldn't make any difference unless it was inside a function that wasn't executing before the button was clicked.
-
13. Re: Button does not work
TLCMediaDesign Aug 24, 2009 12:27 PM (in response to kglad)That's why I never thought of moving it to the top. That is all of the code in
the .fla. I noticed it when I was testing the visibility of the button (which
didn't work when the trace was in the bottom also), I deleted the code and
next time I wrote the trace it was up top and voila! I moved the code for the
button up top and it worked. You can see it never was inside a function, but
it didn't work all the same.



