View Full Version : loading .swf file in a scrollpane {MX}
geedogg
September 6th, 2003, 08:44 AM
Hello:)
Im trying to load a .swf file inside a scrollpane.
But i have NO idea what im doing wrong.
Ive put this pice of code on a button:
on (rollOver) {
play();
}
on (rollOut) {
stop();
}
on (press) {
_root.portfolio.gotoAndStop(81);
display1.loadScrollContent("http://www.bahnhof.nu/gunnar/arbeider/skrompf.swf");
}
Anyone know what im doing wrong?
Voetsjoeba
September 6th, 2003, 08:53 AM
You're doing nothing wrong ... Probably an path error. Try referring to display1 from root and don't forget to give your component the instance name display1 ;)
Oh, and the play() and stop() actions ... Those should be _root.movieclip.play() and _root.movieclip.stop() since it seems pretty useless to me to play a button ... unless you're using a movieclip as button and placed that code on a mc :)
geedogg
September 6th, 2003, 09:04 AM
Hehe, i know i probably dont have the reputation of being th smartest AS guy in here, but i remeberd the instace name ;)
But noe the code is :
_root.display1.loadScrollContent("http://www.bahnhof.nu/gunnar/arbeider/skrompf.swf");
But it still wont work. And i put them on the same server to, so i just dont know whats wrong here.
geedogg
September 6th, 2003, 09:47 AM
Ive looked at macromedias site but still dont get it.
Anyone?????
Voetsjoeba
September 6th, 2003, 09:48 AM
I tested your code on a blank file and it worked fine ... Can we see the FLA ?
geedogg
September 6th, 2003, 09:53 AM
www.bahnhof.nu/gunnar/arbeider/web2.fla
Thanks man.
The button is in menyer>meny portfolio>"Portfolio>trykk"
Voetsjoeba
September 6th, 2003, 10:09 AM
Where did you place the actions you posted ? I'm looking at the SKROMPF button here but there are no actions applied to it ... so where did you place them ??
geedogg
September 6th, 2003, 10:11 AM
hehe:)
If u look in the lib. and follow the path menyer>meny portfolio>"Portfolio>trykk"
When u get to Portfolio>trykk then there is a movie clip behind the SKROMPF thext, and inside that one u will find the actions
geedogg
September 6th, 2003, 10:14 AM
why dont i just tell u what its named u ask :P
Its inside the "Sort knapp animasjon" clip
Voetsjoeba
September 6th, 2003, 10:16 AM
That's what I'm looking at, but there are no actions applied to it ... Anyways, I placed the actions on it, and it works, but only after you've double-clicked the button. I don't know why, I just see that it only displays when pressing the button twice.
on (rollOver) {
play();
}
on (rollOut) {
stop();
}
on (release) {
_root.portfolio.display1.loadScrollContent("http://www.bahnhof.nu/gunnar/arbeider/skrompf.swf");
_root.portfolio.gotoAndStop(81);
}
geedogg
September 6th, 2003, 10:19 AM
inside Sort knapp animasjon there is a clip called rollover, and the codes are on that clip.
Voetsjoeba
September 6th, 2003, 10:21 AM
Oh, riight ... Ok, revision.
geedogg
September 6th, 2003, 10:23 AM
Yes its you who need to check youre eyes, and not me who needs to get my ....together in the lib ;)
Voetsjoeba
September 6th, 2003, 10:23 AM
You used _level1.display1, while it should've been _level0.portfolio.display1. Still, you have to double click the button ... I don't know why that is ...
geedogg
September 6th, 2003, 10:31 AM
this is strange, the skrompf.swf is not inside the scroll pane now, so it scroll across the entire screen.
U know how to get it inside?
Voetsjoeba
September 6th, 2003, 10:36 AM
It is inside the scrollpane, but it just sticks out. Use a mask above the component to make sure only things inside the boxed area are visible.
geedogg
September 6th, 2003, 10:43 AM
aiiit :)
Thanks man!!!!!!!!!!!!!!
But, the scroller keeps on scrolling for a while, even if there is nothing there?
Thats kinda strange.
geedogg
September 6th, 2003, 10:50 AM
now it works with one click :D
on (rollOver) {
play();
}
on (rollOut) {
stop();
}
on (press) {
_root.portfolio.gotoAndStop(81);
}
on (press) {
_root.portfolio.display1.loadScrollContent("http://www.bahnhof.nu/gunnar/arbeider/skrompf.swf");
}
But do u know how to make the scrolling stop when there is nothing more to scroll?
Voetsjoeba
September 6th, 2003, 11:05 AM
It doesn't scroll for me ... it never has ... you're talking about the horizontal scrolling right ?
geedogg
September 6th, 2003, 11:09 AM
Yeah the horizontal scrolling, it ceeps on scrolling untill its outide the left side of the screen. So if i mask it, it will look kinda strange when u keep on scrolling but theres nothing there.
Is there anyway to define the area of horizontal scrolling?
Voetsjoeba
September 6th, 2003, 11:17 AM
Well that would be because the SWF file is too big .. If it's not, you should have to go messing with the scroll code ... If you do so, make sure you backup the current code. If you "Edit in Place" the component, there's an actions layer. There are the actions. Can I see your SWF because it doesn't scroll here ...
geedogg
September 6th, 2003, 12:04 PM
aiiiit, ill try that:)
Thanks!!!
geedogg
September 6th, 2003, 01:01 PM
I dont get this, when i put it in a html document, the scroll works perfecrly and its inside the scrollpane???? Weird.
Check it out
http://www.bahnhof.nu/gunnar/arbeider/web2.htm
geedogg
September 6th, 2003, 01:02 PM
But the scroller keeps on scrolling even if theres nothing there?
Voetsjoeba
September 6th, 2003, 01:05 PM
The scroller works perfectly in the HMTL page. Then just live with it in Flash. You know that it'll turn out ok, so I say don't worry about it :)
geedogg
September 6th, 2003, 01:13 PM
Thanks for all the help man!!!!!!!!!!
if u ever have some problems with the gotoandplay actions im youre man ;)
Voetsjoeba
September 6th, 2003, 01:16 PM
You're welcome =)
glove
September 16th, 2003, 09:47 PM
well,i suppose it'd b nice if after evrything's all said and done,some1 could post the working FLA...as a *conclusion* :P
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.