Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If statment - I have no idea

Status
Not open for further replies.

funkymonk

Technical User
Dec 18, 2000
588
GB
Hi all,

I was wondering if someone could help me with some code.

I have an MC that is trigered from a button. This MC tweens in, and then tweens out again when the user is finished with it. There is a "stop" action on frame 16 for when it is fully extended. The whole clip is about 30 frames.

What happens is this. When the user clicks another button, another menu will come in and fill the area that is still filled with the previous MC, I want to be able to detect if the previous MC is extended or not. If it is at frame 16, I want it to play so it will close (not just dissapear), if it is at frame 0 then I don't want it to do anything.

I'm thinking this is done using the "If" statment but I have no idea on how to use it, write it or anything. I have tried various ways of writing it but with no joy.

Thanx roda B-)

Learning is like rowing against the current. As soon as you stop, you start going backwards.
 
There may be a bettr way to do this, but how about setting a variable in the main time line, from your movie clip?

Essentially when the movie clip is in it's 'off' position (finished playing) you could reset the variable and when it reaches frame 16 set it to a value.

For example:

In frame 0 and also in the last frame of the mc:

_root.myMC_open = "0";

In frame 16:

_root.myMC_open = "1";

Now before you play the movie that will replace your menu, do a quick if statement along the lines of:

if (_root.myMC_open == "1") { _root.myMC.play(); }

Which should force myMC to play; at which point you are free to start your other mc playing. (You could also reset the variable in the if statement by adding a _root.myMC_open = "1" in the if statement.

Hope this is useful.

X-)

PetitPal.
 
Is the _open bit part of the mc name or is it needed for the code?

I haven't a clue outside of simple targeting so please be patient. roda B-)

Learning is like rowing against the current. As soon as you stop, you start going backwards.
 
Roda,

Is this what you're sort of looking for?

It's now a dissolve if you go from button 1 to button 2, but it could be written so that mc1 fades out (or whatever!) before mc2 fades in (or whatever).
You could also close the current opened mc from within, as I have done with mc1, or close it with the "close opened mc" button.

Can email you the .fla if you're interested.

;-)
 
sites coming along nice roda!!
e.gif


carlsatterwhite@endangeredgraphics.com
 
Hi Roda,

In response to the question several posts earlier(!) the _open bit was part of the instance name...

=)

PetitPal
 
Unwanted,

yeah!

Could you e-mail me the .fla? I'm not having any luck with this so far (this feels like one of those big leaps into the unknown again!). roda@sameplanet.co.uk

I tried the one above from PetitPal but I'm having no joy with it, if I see the .fla I should be able to form the picture in my head and so understand it better.

Thanks Virt, If I can't get my MC's not to re-size (the one displaying my art) then I may have to start thinking re-design as it stretches my art all over the place depending on the browser size/shape. I do love creating new designs and interfaces so that's too much of a problem. ;-)

roda B-)

Learning is like rowing against the current. As soon as you stop, you start going backwards.
 
You oughta see my site roda, its somewhat like that...but I kinda need to find time to work on it and get some animation in it...mainly I stopped when I was having a problem with some of the buttons. When life gives you lemons...throw them back and get the oranges you ordered! :-Q
 
Roda,
Just e-mailed you the .fla.

Check what relates to the /:currentmc, that's really what you're looking for.

I guess you want to use this on your site when going directly from about me & contact me for instance, so as I said, try addapting it...

If you can't make it work, come back to me, I'll try to work something out for you!

;-)ldnewbie
 
Cheers Old!

I'm having probs with my mail at the moment but I'll get that sorted soon and grab the file.

Yes, I do want this for the menu's as well as something else I'm playing with. As far as I can tell, this is going to be a handy thing to know for the future of my designs so I better get on with it. roda B-)

Learning is like rowing against the current. As soon as you stop, you start going backwards.
 
That was excellent old and thanks all for the response. roda B-)

Learning is like rowing against the current. As soon as you stop, you start going backwards.
 
But you haven't applied it to your site yet, right?

Might I suggest that when you do, you also close any left opened mc (contact, friends etc...) when opening something in the galleries' menu.

As for your scaling problem (not really wanting the users to change the scaling of your paintings for instance), you could open your whole site in another unsizable window!

Take care,

;-)ldnewbie
 
I am in the process of designing another site. I thought of ways I could stop the re-sizing of my images and opening in a new window was something I didn't really want to do. As I'm doing this for myself, time is not really an issue and I love designing new interfaces (my site will probably change about every 4-6 months)LOL Also, each time I design a new site interface I learn something about how to piece it together.

The help you gave me was for the new design, It's a lot sleeker (I think) than the one that's up at the moment and it's also fixed size and centred in the page so no resize probs.

Anyway, I will most likely be back soon with more shouts for help. I want to put on a side scroller menu and have just started to look at the one dave put in the faq's section. OOOOer!!:-0



roda B-)

Learning is like rowing against the current. As soon as you stop, you start going backwards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top