Fuction call (trivial)

You can just use this code:

[AS]onClipEvent(enterFrame) {
if (this._currentframe == 20) {
visibleTrue();
}
}
[/AS]

Put it on the movieClip you want to control with it…

oh yeah, the delete should have a space after it, not a . - typo

delete this.onEnterFrame;

Nope, just won’t do…

I don’t know why, I’ve put several frames, just wont call it, the function works when i call it from any button or from the main timeline directly…

I’ve jut tried putting a marker so it only runs once and the trace comes out clean just after the function call, but it doesnt go into the function (I have a trace there too)…

It just won’t CALL IT! The call executes but it seems to do nothing. I’ve double checked the names, don’t know what else there is…

[AS]
onClipEvent(enterFrame) {
if (this._currentframe == 20) {
_root.visibleTrue();
}
}
[/AS]

Perhaps if you use my code, add the ‘_root’ element?

Senoculars code should work perfectly i guess…

[AS]
clipName.onEnterFrame = function() {
if (this._currentframe == 20) {
visibleTrue();
delete this.onEnterFrame;
}
}
[/AS]

Ok that solve d the getting into the function :smiley: (I thought functions could be called from wherever…) -> thanks

BUT it doesn’t solve the problem, it gets into the function but does not execute it, let me show you some code…

[AS]
//first frame
//this is just so the call of the fuction doesn’t repeat
_root.globalMarker = 1;

//UNvisible
function visibleFalse() {
logo_mc._visible = logo._visible = false;
stat_mc._visible = stat._visible = false;
vector_mc._visible = vector._visible = false;
flash_mc._visible = flash._visible = false;
play_mc._visible = play1._visible = false;
pack_mc._visible = pack._visible = false;
interface_mc._visible = interface1._visible = false;
graphic_mc._visible = graphic._visible = false;
web_mc._visible = web._visible = false;
other_mc._visible = other._visible = false;
}

//making it unvisible at start
visibleFalse();

//visible
function visibleTrue() {
logo_mc._visible = logo._visible = true;
stat_mc._visible = stat._visible = true;
vector_mc._visible = vector._visible = true;
flash_mc._visible = flash._visible = true;
play_mc._visible = play1._visible = true;
pack_mc._visible = pack._visible = true;
interface_mc._visible = interface1._visible = true;
graphic_mc._visible = graphic._visible = true;
web_mc._visible = web._visible = true;
other_mc._visible = other._visible = true;
trace(“id”);
}
[/AS]

and on the clip
[AS]
onClipEvent(enterFrame) {
if (this._currentframe == 20) {
if(_root.globalMarker == 1){
_root.visibleTrue();
_root.globalMarker = 0;
}
}
}
[/AS]

PS: I SUCK

Shouldn’t this be
[AS]
if(_root.globalMarker == 1) {
[/AS]

Or is this glM another variable?

Yes sorry, it isn’t in the code I’ve renamed all the glM to globalMarker so you would understand easier, sorry about that -> its not an error, I’ll edit it so it doesn’t cause any more confusion

What’s with that “logo_mc._visible = logo._visible = true;”, the instance names ‘logo_mc’ and ‘logo’?

Maybe you’ll need to change it to:
[AS]
logo_mc._visible = true;
[/AS]

I just don’t get the point :h:

Ok I see I’m confusing everyone (because of the lack of knowlegle probably)…

could you look up the FLA, I’ve simplified it, removed everything but the problem itself -> thanks

cheers

I’ve taken a look at your fla, but I still can’t quite figure out what the purpose is. Can you briefly explain (again?) what’s not working, and what should be changed so it works…

First of all thanks for helping me out! I know I’m a pain in the *** :smiley:

Here goes:
-I’ve created some obviously too complex navigation for my site
-I have a button for the portfolio which has two types of animation (2 seperate masked MCs) one is for rollOver & rollOut and the other is for press

-the one for press is what bugs me, it “drops down” from the button (this is the second masked MC)

-apart from this I have buttons positioned where the MC scrolls down which are not visible (_visible = false)

->I want to enable those buttons when my animation completes, when that “drop-down” (masked MC)

competes (on frame 20), I want to call a function that enables those buttons…


Does this clarify? If you don’t understand something please say (my english isn’t that good, that is probably the biggest problem)

cheers

Dude, this is hard :slight_smile:

I want to enable those buttons when my animation completes, when that “drop-down” (masked MC) competes (on frame 20), I want to call a function that enables those buttons…

So, can you name me the instance name of the movieClip where you want the function to enable those buttons on frame 20. Is it the ‘F_under’ instance?

It’s quite difficult to figure out your code, but I’m gonna try and help you here, so bare with me :slight_smile:

Yup, the F_under instance…

-> on the 20th frame it should enable the buttons :smiley:

thanx a bunch

Can’t you just add this line of code under the ‘stop();’ on the actions for the 20th frame?

[AS]
_root.visibleTrue();
[/AS]

Or am I just being lazy? :wink:

Khmmm…

Not even going to answer that :smiley:

So did it work out?

Of course not :smiley:

That was the first thing I’ve tried.

For some reason it won’t enable the buttons, it enters the function but it seems like it just doesn’t execute the XXX._visible = true;

dasfk.jh ilwakejhf nq2i7znc vgcvoučer

**** it!

I’ve redone it manually!

SINTAX I’m totally thankful for baring with me, but I’ll go insane with this!

I’m out, THX again!

:smiley:

You could have just edited the path in the function so they looked like this:
_root.logo_mc._visible = _root.logo._visible = false;