Groups | Blog | Home
all groups > flash (macromedia) > november 2005 >

flash (macromedia) : What is root.link


-->dan mode
11/28/2005 4:40:30 PM
looks like link is a variable. do you see that code somewhere?


--

Dan Mode
*Must Read* http://www.smithmediafusion.com/blog

__
[quoted text, click to view]

Tangier Clarke
11/28/2005 10:50:18 PM
I bought a template that I am modifying and the buttons only work with this
code that the author put in:

on (release) {
if (_root.link<>8) {
_root.link = 8;
_root.play();
}
}

I don't know what it's doing nor how to use it.

I'd rather use a simple button action script, but I can't get any to work:


on (release) {
gotoAndPlay("Scene 1", maintitles);
}

nor


on (release) {
gotoAndPlay("Scene 1", "maintitles");
}
Tangier Clarke
11/29/2005 12:46:49 AM
I wouldn't know where to find it. Someone told me to check the Explorer, but I
dind't see it there. This code is being used for the nav buttons on this
template (http://www.templatemonster.com/flash-templates/8521.html), but I
don't know how to use this.

What's more upsetting, is just using basic linking code as I wrote above
doesn't work and I don't know why.
Tangier Clarke
11/29/2005 12:46:53 AM
I wouldn't know where to find it. Someone told me to check the Explorer, but I
dind't see it there. This code is being used for the nav buttons on this
template (http://www.templatemonster.com/flash-templates/8521.html), but I
don't know how to use this.

What's more upsetting, is just using basic linking code as I wrote above
doesn't work and I don't know why.
Tangier Clarke
11/29/2005 3:36:53 AM
Urami, thanks for that code hlep. For the first time the button actually
worked (sort of). I have one question though. The code you gave me worked as
you said and jumped directly to a labeled frame, but it didn't finish playing
out the rest of the previous label marker before jumping to the one I clicked
for.

Please see my jpeg at http://tangierclarke.com/flash_timeline.jpg

- For instance when I click a button on the my nav bar it jumps to s4 and
stops at frame 235 - works good with the author's code

- I added your code to the "Main Titles" button that you'll see in the image
It works, but doesn't complete the transition - frames 236-276 before jumping
to the link I requested. Frames 236-267 are where the frame I am stopped on
fade out then the squares rotate before jumping to the correct section.
(http://www.templatemonster.com/flash-templates/8521.html). The author's code
on frame 267 looks like:

label = "s"+_root.link;
gotoAndPlay(label);


It seems like the author defined his/her own variables, but I can't find them.



urami_
11/29/2005 8:57:49 AM


[quoted text, click to view]

Well, there is some kind of transition, most probably multiple sections on main timeline.
Once the button is clicked it will set a flag what link is being used so when next button is clicked
the first link will close and than the new button action will proceed.
A neat way to keep open-close-open kind of transitions.
All these templates are made in similar fashion, done plenty of these myself.

[quoted text, click to view]

Well, it's not that simple, you will need to make major changes in the whole file.
Why not just start from scratch, copy paste the graphics if you like them and code it
according to your preference. Just a little side note, the above action would not be correct
to use. Widely discuss on forum hundreds of times in past years that scenes are ONLY
for authoring purpose , they are not included in final SWF files . Your movie become one
long timeline once exported and Scene basically are to give an end to one and beginning to
another timeline . That's why you can't target them in your actions.
If scene 1 has 10 frame and scene 2 has 10 frames , on export it become 20 .
SO first frame of second scene will become not 1 but 11 .
Labels are what you after .

Attach unique label to first frame of scene you like to target and use

_root.gotoAndPlay("labelNAme");

--
Regards

Urami

--


<urami>
http://www.Flashfugitive.com
</urami>

<web junk free>
http://www.firefox.com
urami_
11/29/2005 12:20:35 PM
[quoted text, click to view]


The author does not just jump to frame, the S-label define starting animation
of next content and instead of jumping directly they play the opening sequence first and stop
on frame where the entire content is.
The Slabel is not exactly on the frame you aiming but before the frame.

The above clearly shows.

on (release) {
if (_root.link!=1) {
_root.link = 1;
_root.play();
}
}

So with click it sets s1, than it runs timeline when it comes across

label = "s"+_root.link;
gotoAndPlay(label);

and this pushing it to the s1 label regardless where you are on timeline making it
it play the sequence.
See, this is something you can't really do with scenes that is why they stay on same timeline.
Doing transition across scenes is way more messy than on the same timeline and it's way more
problematic.
I'm not sure why would you want to change something what already works for you well but that's your
file and design concept. Do not fix it if it's working, that's my kind of point of view.



--
Regards

Urami

--


<urami>
http://www.Flashfugitive.com
</urami>

<web junk free>
http://www.firefox.com
Tangier Clarke
11/29/2005 2:46:38 PM
Thanks Urami. You are right, I don't want to change the code. I am willing to
use it by copying and pasting it for any other buttons I want to create.

I am just trying to understand how the author's code is working.

- I am confused that even though I see a flag on a certain frame that you tell
me that is not the actual frame the label is for.
- I understand how the timline stops on a certain frame, but not how it
finishes that segment with the transition before going to a link I clicked.
- I don't know where to find the "link" in _.root.link.

I liked your code because it is a lot simpler. I just can't figure out how to
get the transition to play first.

I would not mind reusing the athours's code, but I have to fully understand it
before I can use it. You seem to know Flash very well.

Thanks for your help. I am trying hard to figure this all out. It's the last
thing I have to figure out before I can finish building the site.
x126
1/20/2007 6:49:16 PM
I am having the same issue on
http://www.robertbusse.com/BusseTemplates/index.php?action=showdetail&item_numbe
r=9498
I figured out how to change the pages that get called - I also understand the
how they get called - what I am trying to do is duplicate a page - restructure
it - and call it - but how do you label it?

example:
on (rollOver) {
gotoAndPlay("s1");
}
on (releaseOutside, rollOut) {
gotoAndPlay("s2");
}
on (release) {
if (_root.link<>4 and _root.flag == 1 and _root.flag1 == 1) {
_root.dots.play();
_root.pages.pages1["page"+_root.link].play();
_root.link = 4;
_root.flag = 0;
_root.flag1 = 0;
_root.pages.play();
}
}

note: root.link<>4 - is what I want to change -

any insight - would be helpfull - this project is due monday 1-22-2007
AddThis Social Bookmark Button