This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Flash Site Design > June 2005 > *NEWBIE* Linking to frames
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
*NEWBIE* Linking to frames
|
|
| rclifto2 2005-06-28, 7:24 pm |
| :confused; I've searched for quite a while through the forums before
posting... can't find a similar situation...
What I'm trying to create is a brochure in which frame 1 will be the complete
brochure that contains 25 buttons/links. Frames 2-26 are the information pages.
When pressing the button, there is a considerable delay before the link
manifests. I'm using the basic actionscript of:
on (release) {
this.gotoAndStop("5");
}
Why the delay? Be gentle - I told you I'm new. Thanks in adavance.
| |
| David Stiller 2005-06-28, 7:24 pm |
| rclifto2,
> When pressing the button, there is a considerable delay before
> the link manifests. I'm using the basic actionscript of:
>
> on (release) {
> this.gotoAndStop("5");
> }
>
> Why the delay?
Much of this depends on what object you've attached your on() handler
to. Is it a button symbol, a movie clip symbol? The answer determines what
the word "this" refers to, as used in the event handler.
David
stiller (at) quip (dot) net
Tackling the ActionScript Language Reference
http://www.quip.net/tutorials/
| |
| rclifto2 2005-06-30, 7:48 pm |
| It is attached to a button symbol. For example, "Name" may be the button
symbol and I am trying to link it to frame 5 that has info on the name.
I previously used the "on(release)" script without "this." but I read in
several places that it is good practice to include it.
| |
| David Stiller 2005-06-30, 7:48 pm |
| rclifto2,
> It is attached to a button symbol.
Okay, given that, the "this" in this case refers to the timeline in
which the button resides. If this were a movie clip symbol, the "this"
would refer to the movie clip's own timeline.
So the following code ...
on (release) {
this.gotoAndStop("5");
}
.... would send the timeline -- the timeline in which this button resides --
to frame 5.
Ah, but wait! That 5 is in quotes. Why is that? Frame numbers aren't
strings (quoted items), but rather, numbers. The ActionScript, as written,
causes the Flash Player to look for a frame label named "5," and I suspect
there is no such label, right? Look up MovieClip.gotoAndStop() in the
ActionScript Language Reference and you'll see that this method accepts an
"object" ... which means either a number or a string. Since your aim is to
send the playhead to a frame, try removing the quotes.
David
stiller (at) quip (dot) net
Tackling the ActionScript Language Reference
http://www.quip.net/tutorials/
| |
| rclifto2 2005-06-30, 7:48 pm |
| David,
I initially had frame labels but also tried it pointing directly to the frame.
There is still about a 1.5 second delay. Rather than waste your time on a
very minor problem, I think I'll just add to each button on the "down" frame so
that there is a little bit of animation and switch the "on(release)" action to
"on(press)". Maybe this will give a smoother & quicker transition appearance.
I really appreciate you offering your knowledge and experience to help me with
my problem. BTW: Great site - you put together some cool stuff!
| |
| David Stiller 2005-06-30, 7:48 pm |
| rclifto2,
> I initially had frame labels but also tried it pointing directly to the
> frame. There is still about a 1.5 second delay.
That's odd. I could take a look at your FLA, if you like. If you want
send me an attachment.
> Rather than waste your time on a very minor problem, I think I'll
> just add to each button on the "down" frame so that there is a little
> bit of animation and switch the "on(release)" action to "on(press)".
I shouldn't think that would be it, because the events are fired
independent of whatever animation occurs on the button frames. I perfer the
on (release) event personally because it allows the user to change his mind.
Haven't you ever clicked on a button, then dragged off and released without
being over the button? Doing so typically acts as a kind of "cancel" to
whatever the button does. By using on (press), the user commits himself to
the action as soon as the mouse button is clicked. This workaround might
just do it for you, though. Still, I'd be curious until I figured out the
solution. ;)
> I really appreciate you offering your knowledge and experience
I'm happy to help. :)
David
stiller (at) quip (dot) net
"Luck is the residue of good design."
| |
| rclifto2 2005-06-30, 7:48 pm |
| David,
As I looked to send the .fla I realized that the size of this seemingly small
file was 2.56mb. Could file size create a delay? I copied & pasted an image
from a .pdf straight into flash. Should I break those images apart -or does
that matter?
| |
| David Stiller 2005-06-30, 7:48 pm |
| rclifto2,
> As I looked to send the .fla I realized that the size of this seemingly
> small file was 2.56mb. Could file size create a delay?
That is possible, actually. Is the FLA that big, or is that the SWF?
(I'll need the FLA, by the way, if you want me to take a look at it.)
> I copied & pasted an image from a .pdf straight into flash. Should I
> break those images apart -or does that matter?
May not be a bad idea, but it all depends on the image and how it needs
to be used. If your compiled SWF is 2.5MB, you may want to consider
optimizing.
David
stiller (at) quip (dot) net
"Luck is the residue of good design."
| |
| rclifto2 2005-06-30, 7:48 pm |
| David,
I took out some content to send you a scaled-down .fla and it seems to have
decreased the lag a bit. Could you let me know if the existing lag is normal
or am I nit-picking? Here's a beginner question for you: do I send the .fla
to your personal email or is their a way to attach it to this post? (Couldn't
find one).
| |
| David Stiller 2005-06-30, 7:48 pm |
| rclifto2,
> I took out some content to send you a scaled-down .fla and it
> seems to have decreased the lag a bit.
That begins to make it sound as if the file size is your problem, but
heck, I'll give your FLA another set of eyes.
> Could you let me know if the existing lag is normal or am I nit-
> picking?
Will do.
> Here's a beginner question for you: do I send the .fla to your
> personal email or is their a way to attach it to this post?
I think it depends on how you post -- whether you're in the forum via
web browser or a news client -- but in any case, go ahead and just email me
personally. I don't normally desire things sent directly this way, but your
issue has my curiosity piqued.
David
stiller (at) quip (dot) net
"Luck is the residue of good design."
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|