Goto - midframe button problems

This is a discussion on "Goto - midframe button problems" within the Flash & Multimedia Forum section. This forum, and the thread "Goto - midframe button problems are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jul 27th, 2007, 19:45
Junior Member
Join Date: Jun 2007
Location: Leeds, England
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Goto - midframe button problems

Hi peps,

Wondering if you can help. Please could you look at a site that is under construction.

www.selfcatering-bridlington.co.uk

I have a midframe action working. Playing an intro and an outro. If you could look at the 'AROUND BRIDLINGTON' button. It loads in fine, but when you click another button you will see my problem. The script stops when needed. you can use the goto and stop buttons.

When you click away the animation plays from that point to the end of the animation.

Is there a way of jumping the animationto the outro only???

Thanks for taking your time to help me out.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jul 30th, 2007, 14:56
Multimedia Specialist
Join Date: Apr 2007
Location: Arizona
Age: 25
Posts: 666
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Goto - midframe button problems

That is why I am seeing the delay between clicking the button and it playing the animation I presume....

Did you use this tutorial to build it? If not check it out this is how it should be structured.

http://www.kirupa.com/developer/mx2004/transitions.htm
Last Blog Entry: Yay!? (Oct 8th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jul 31st, 2007, 21:10
Junior Member
Join Date: Jun 2007
Location: Leeds, England
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Goto - midframe button problems

Hi Sgaspar11 (Scott if I remember correctly??)

Thanks for the guidance. Yes I did use that tutorial. The transitions worked fine, the problem I am having is the 'go to' and 'stop' command. If the play head jumps to a certain point then the user clicks another button the play head plays the remains 'go to' and 'stop' animations then plays the fade out transition. Do you know if there is any actionscript I might be able to use to make the play head jump to the fade out animation when the user clicks another navigation button?

Thanks again for your help

Toby
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jul 31st, 2007, 21:34
Multimedia Specialist
Join Date: Apr 2007
Location: Arizona
Age: 25
Posts: 666
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Goto - midframe button problems

I am sure there is, this will take some thinking...and right now I got a bad bad head cold and probably won't be able to think in a code mindset right now....
Last Blog Entry: Yay!? (Oct 8th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Aug 1st, 2007, 21:07
Junior Member
Join Date: Jun 2007
Location: Leeds, England
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Goto - midframe button problems

No worries. Hope you feel better soon.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Aug 6th, 2007, 20:44
Junior Member
Join Date: Jun 2007
Location: Leeds, England
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Goto - midframe button problems

Is there anyone else that might know the answer out there?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Aug 6th, 2007, 22:00
Multimedia Specialist
Join Date: Apr 2007
Location: Arizona
Age: 25
Posts: 666
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Goto - midframe button problems

Do you have any experience writing IF statements? Let's think together how this would look. I'm gonna learn you. :-P

Using IF and THEN statements, just talk out what you think this should look like from an AS perspective. The code doesn't need to be proper, just write it out to start...

:-)
Last Blog Entry: Yay!? (Oct 8th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Aug 7th, 2007, 18:46
Junior Member
Join Date: Jun 2007
Location: Leeds, England
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Goto - midframe button problems

Thanks scott. Hope you are feeling better. I have dabbled in PHP. I'll give it a go.

Cheers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Aug 7th, 2007, 20:03
Junior Member
Join Date: Jun 2007
Location: Leeds, England
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Goto - midframe button problems

if (another button is pressed){
then this.gotoAndPlay("80");
}

Am I on the right track? Do i need to specify the buttons as variables?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Aug 8th, 2007, 17:10
Multimedia Specialist
Join Date: Apr 2007
Location: Arizona
Age: 25
Posts: 666
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Goto - midframe button problems

yep you need to specify the buttons and/or certain frames as a varible....

So you could say something in that IF statement like....

If (currently frame !=(does not equal) "A Certain Frame")
{
gotoAndPlay("80");
}
Last Blog Entry: Yay!? (Oct 8th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Aug 9th, 2007, 18:47
Junior Member
Join Date: Jun 2007
Location: Leeds, England
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Goto - midframe button problems

Thanks Scott. I have been trying to figure out where the IF statement should go.

I take it that its not on the midframe? Or on the movie that is 'Around Bridlington'?

So perhaps the buttons? But would that work? each movie is of different length.

Also, is an instance name or frame name the same as declaring a variable? Or do I need actionscript?

Thanks for sticking by me Scott. I'm really grateful for your help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Aug 9th, 2007, 19:41
Multimedia Specialist
Join Date: Apr 2007
Location: Arizona
Age: 25
Posts: 666
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Goto - midframe button problems

Yep, there are a couple of places you can put this.

You can either place it right on the button(which I wouldn't reccomend) or you can use the "." syntax on your actions layer to call it....

Let's say your button has an instance name of "button" (properties panel, lower left corner)

you could use something like:

Code: Select all
button.onRelease = function()
{
ifstatement goes here.
}
Last Blog Entry: Yay!? (Oct 8th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Aug 10th, 2007, 16:58
Junior Member
Join Date: Jun 2007
Location: Leeds, England
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Goto - midframe button problems

Hi Scott,

I have this:

Quote:
home.onRelease = function()
{
If (current frame != "77")
{
gotoAndPlay("80");
}
There is an error in the if statement. I hope you can help me out again. Is 'current frame' allowed? I'm not sure the syntax is right either Errors suggest that I am missing/have too much brackets etc.

Also, I have given instances to all my buttons now. I presume that I would have to duplicate this actionscript replacing 'home' with the other buttons? Or can I use another method? Arrays are groups of variable aren't they? In PHP I could have done this with a '$buttons' declaration.

Thanks again for your support.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
Old Aug 10th, 2007, 18:29
Multimedia Specialist
Join Date: Apr 2007
Location: Arizona
Age: 25
Posts: 666
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Goto - midframe button problems

You are missing a } at the very end of the code...

Make it look like this:

Code: Select all
home.onRelease = function()
{
If (current frame != "77")
{
gotoAndPlay("80");
}
}
Yes, you can use array's in flash to make this easier, or you can just apply this code to every button and change the "home" to the different instance names.

Let's get this working on 1 button though before we talk about arrays.

Cheers,

Scott
Last Blog Entry: Yay!? (Oct 8th, 2007)

Last edited by Sgaspar11; Aug 10th, 2007 at 20:40.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #15  
Old Aug 13th, 2007, 11:23
Junior Member
Join Date: Jun 2007
Location: Leeds, England
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Goto - midframe button problems

Hi Scott. I put the code on my button and it was dead. I already have the code:

Code: Select all
 
on (release) {

if (_root.currMovie == undefined) {

_root.currMovie = "Self_home";
Main_Loader.loadMovie("Self_home.swf");
} else if (_root.currMovie != "Self_home") {
if (Main_Loader._currentframe >= Main_Loader.midframe) {

_root.currMovie = "Self_home";
Main_Loader.play();

}

}

}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #16  
Old Aug 18th, 2007, 14:56
Junior Member
Join Date: Jun 2007
Location: Leeds, England
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Goto - midframe button problems

Does anyone have any ideas?

Scott mentioned:

Quote:
you can use the "." syntax on your actions layer to call it....
Does anyone have any advice/tutorials on the "." syntax?

Thanks
Toby
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #17  
Old Aug 20th, 2007, 15:56
Multimedia Specialist
Join Date: Apr 2007
Location: Arizona
Age: 25
Posts: 666
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Goto - midframe button problems

That is what you are already using with that script, mostly.

The other thing you can do is give the button on instance name, say "button"

And instead of placing the code on the actual button, you would create and actions layer and say say:

button.onRelease = function() //button is the name of the button.
{
code goes here.
}

Not sure if that'd fix the problem but it is defiantely cleaner
Last Blog Entry: Yay!? (Oct 8th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #18  
Old Aug 20th, 2007, 20:34
Junior Member
Join Date: Jun 2007
Location: Leeds, England
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Goto - midframe button problems

Awesome. Your a star Scott. thanks again for your support. I will try that and get back.

Cheers.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #19  
Old Aug 28th, 2007, 18:12
Junior Member
Join Date: Jun 2007
Location: Leeds, England
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Goto - midframe button problems

Hi Scott,

I have finally found five mins to look at this again. Thanks for the input.

I am getting an error on the IF statements.

Quote:
')' or ',' expected�
Code: Select all
contact.onRelease = function()
{
If (current frame != "77")
{
gotoAndPlay("80");
}
I'm sure your getting fed up with this now. Hopefully it will twig and I will get it sorted. Than