Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: RE: [flasher] RE: Functions 101
From: AndyA
Date: Sat, 24 Mar 2001 00:31:58 -0000

Mmmm yes. I see what you mean.

I used the example in the tutorial as a way of showing how a function would
work, so using tellTarget wouldn't have been much use. It makes the function
in the tutorial a little pointless, but at least it didn't require me to
write a completely new example for the 101. I'll write a new one this
weekend. For now I just wanted to get a quick correction out before anyone
ripped hair out trying to get it to work! =;o)

The issue I've found has to do with a rather odd thing going on. I extended
and existing script that a friend had given me. In working out the solution
to the above I came across the following:

I defined a function on the main timeline:

Function playScene (sceneRef, frameRef)

gotoAndPlay (sceneRef, frameRef);
}

with the idea being to invoke the function from a button using

playScene ("myScene","myLabel")

... now here's the thing. When I went to debug it, the movie tried to
execute the gotoAndPlay that was inside the function definition! And it
worked... it complained about the sceneRef and frameRef not being in quotes
(duh) and promptly jumped to the second scene which was named "Second".

What's up with that?

Anything inside the curly brackets of a function definition isn't supposed
to be executed until the function is invoked. But here it was doing it
anyhoo!

So then I did:

Function playScene (sceneRef, frameRef)

trace ("In function");
gotoAndPlay (sceneRef, frameRef);
}

No trace appeared, but the gotoAndPlay was still being executed.

Then I did:

Function playScene (sceneRef, frameRef)

trace ("In function");
// gotoAndPlay (sceneRef, frameRef);
}

to be on the safe side and (as expected) the gotoAndPlay did nothing and
when I clicked on the button I got the trace...

Sooo... basically, Flash was executing the gotoAndPlay that was inside my
function definition, even though the function wasn't being called.

Which is very weird.... trying to work it out now.

A






-----Original Message-----
From: derrickito [mailinglistatclarknewmedia [dot] com (mailto:mailinglistatclarknewmedia [dot] com)]
Sent: 24 March 2001 00:10
To: flasher from chinwag
Subject: [flasher] RE: Functions 101


on your button, use a tell target actionscript, its in the basic actions.

inside the tell target, target the main timeline with a "_root"
then use a go to action, specifically, go to a framelabel.


----- Original Message -----
From: "AndyA" <meatandya [dot] demon [dot] nl>
To: "flasher from chinwag" <flasheratlists [dot] chinwag [dot] com>
Sent: Friday, March 23, 2001 2:48 PM
Subject: [flasher] RE: Functions 101


> How do you mean Derreckito? Could you post the code?
>
> I know I had the function working at one time and had tested it, but I
never
> saved the file. Then along the way, I changed it and can't remember how to
> get it back! Arggghh
>
> A
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> The Chinwag site carries a wealth of Flash resources.
> Find useful links, suggested reading and archives at:
>
> ** http://www.chinwag.com/flasher **
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> You are subscribed to flasher as: mailinglistatclarknewmedia [dot] com
> To unsubscribe, email leave-flasher-485112Oatlists [dot] chinwag [dot] com
>
>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Chinwag site carries a wealth of Flash resources.
Find useful links, suggested reading and archives at:

** http://www.chinwag.com/flasher **
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You are subscribed to flasher as: meatandya [dot] demon [dot] nl
To unsubscribe, email leave-flasher-485112Oatlists [dot] chinwag [dot] com




[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]