Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button Requires 2clicks to load external swf

Status
Not open for further replies.

esearing

IS-IT--Management
Aug 22, 2000
132
US
On a shell movie I have 5 buttons inside a Menu MC. The buttons load external swf's to a container MC (named holder or holderLeft). In test mode I only have to click the buttons once. On the web I have to click them twice to get them to work. I waited between clicks to test if it was a loading time issue, but nope, requires 2nd click.
Once the external movie has been loaded once, it only takes one click to replay it.

See Photography button is not yet active.

Button Code
on (release) {
_root.holder.loadMovie("mySwf.swf", 5);
}

mc "holder" actions to slide in menuitems MC
onClipEvent ( load ) {
_x=1000;
_y=110;
xtgt=125;
_alpha=30;
setProperty(_root.holderLeft, _visible, false);
setProperty(_root.holderRight, _visible, false);
}
onClipEvent (enterFrame){
_x+=(xtgt-_x)/10;
if (_alpha < 100){
_alpha+=5;
}
}

eSearing.com
a work in progress
 
Why does Contact work on a first click?
Must be in your coding... Hard to say without having a full look at it!
Can you post a mock-up .fla, with the same coding?

Regards,
new.gif
 
Thanks for responding so quickly.

Contact uses attachMovie to attach a simple mc to the menu mc. The other buttons use loadMovie to load the external swf into the container MCs (holder & holderLeft). holder is empty until the loadMovie action.

Contact button actions.
on (release) {
attachMovie(&quot;mc_contact&quot;, &quot;c&quot;, 10);
c._x = 100;
c._y = 200;
setProperty(_root.holder, _visible, false);
setProperty(_root.holderLeft, _visible, false);
setProperty(_root.holderRight, _visible, false);
}
eSearing.com
a work in progress
 
Well, can you post some .fla? Or e-mail it to me, or better e-mail me a link to it?
IMHO, you do have another problem (as a lot of posters here have!), when on a second press, the called mc repeats from the start.
You're right in saying that once loaded, one click will suffice, but hitting any button for a second time (while already on it), will restart the selection from the beginning, and it shouldn't!

Regards,
new.gif
 
Fla is zipped at
esearing.com/Flash_Files/escomMenu.zip

I included the links.swf so you can test the AS on the links button.

I fixed one syntax issue. I removed the level number in the loadMovie.

You help is greatly appreciated. eSearing.com
a work in progress
 
figured it out.

Had to move my setProperty statements from the holder MC to the buttons. eSearing.com
a work in progress
 
Well try Flash Samples followed by Links... Or contact followed by link!
And a second press re-initiates the whole thing from the start. I'm sitting on Links right! I hit links again, why doesn't it just stay there, rather than come back in? Get my drift?

Regards,
new.gif
 
Because it reloads the external swf. when it reloads the swf it positions the MC at _x=1000 then slides it to the xtgt.
I haven't put in a method to check if the newswf==oldswf yet. I assume I can set a variable on the root which tells me which button was last pressed then add AS to prevent loading of the same movie.

I might even try to fade or slide the current movie before loading the next.

Thanks for the response anyway. eSearing.com
a work in progress
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top