all groups > flash (macromedia) > december 2003 >
You're in the

flash (macromedia)

group:

external swf buttons


external swf buttons ritpas
12/19/2003 9:24:06 PM
flash (macromedia): Hi,

I've created a web site, when clicking on the "accueil" link, it loads an external swf file called "accueil.swf". The latter contains two buttons (previous and next) and both work properly directly within the "accueil.swf" file, but not when the movie is loaded into the source ".swf" : though the rollover states are working the actions assigned to the on(released) event are not executed!
Has anybody an idea?

the site can be seen at the following address :


Thanks,

Pascal



Re: external swf buttons stwingy
12/19/2003 9:57:54 PM
I think you really need to show some code etc to get an answer. Have you made reference to _root in the on(release) function?

Certified but not by Macromedia!
Re: external swf buttons ritpas
12/19/2003 10:08:27 PM
Yes here is the code of the external "accueil.swf" file :
\\code in the root of the maintimeline
stop();
this.p2._visible = false; \\p1,p2,p3 : objects containing eacha photo
this.p3._visible = false;
this.current = 1;\\var containing the number of the current photo

\\code in the actions of the "next" button (the same can approximately be found in the "previous button)
on (release) {
_root["p"+_root.current]._visible = false;
_root.current++;
if (_root.current == 4) {
_root.current = 1;
}
_root["p"+_root.current]._visible = true;
_root["p"+_root.current].play();
}


Thanks for your answer

Re: external swf buttons stwingy
12/19/2003 10:29:21 PM
try replacing _root by this or if your button is an mc by _parent.


Certified but not by Macromedia!
Re: external swf buttons ritpas
12/19/2003 11:27:01 PM
Thanks it works fine!!
Just a question : obviously, _parent cannot be used with buttons, can they?


Re: external swf buttons stwingy
12/19/2003 11:46:05 PM
Yes it can, for example, if you have a movieclip on the main timeline and a button on the mcs timeline, with code
on(release){
_parent.gotoAndStop(10)
}
on the button
this would take the maintimeline to 10.(not the movieclips)

Certified but not by Macromedia!
Re: external swf buttons ritpas
12/20/2003 12:13:52 AM
ok thanks.
A new pb appeared similar to the first one, but now it doesn't concer the buttons but a effect sound.
The sound plays properly when launched within the "accueil.swf" but not when launched within the source file!
that's the associated code containedin a MC of accueil.swf :
//beginning of the tween of the MC's timeline
this.son = new Sound();
this.son.attachSound("clic");
this.son.start();
// end of the tween
this.son.stop();

Any idea?
Thanks in advance,


Re: external swf buttons stwingy
12/20/2003 8:25:52 AM
try this
son = new Sound(this);
son.attachSound("clic");
son.start();




Certified but not by Macromedia!
Re: external swf buttons ritpas
12/20/2003 8:36:56 AM
I'm not completely sure but I've already tried it and it didn't work either.
I will try anyway and let you know. Thanks anyway.


AddThis Social Bookmark Button