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
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!
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
try replacing _root by this or if your button is an mc by _parent. Certified but not by Macromedia!
Thanks it works fine!! Just a question : obviously, _parent cannot be used with buttons, can they?
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!
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,
try this son = new Sound(this); son.attachSound("clic"); son.start(); Certified but not by Macromedia!
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.
Don't see what you're looking for? Try a search.
|