Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 10-10-2006, 16:28   #1 (permalink)
Neuer User
 
Registriert seit: Aug 2005
Beiträge: 11
Subbutton funktioniert erst beim zweiten Klick

Hallo,

ich verwende für eine Website das dynamische, horizontale Menü von Ultrashock.com.

hier der Code:
PHP-Code:


onClipEvent 
(load) {
    
// -- set up names of main items here
    // -- you can add as many new sections as you want (or your computer can handle)
    
mainSections = new Array("PHOTOGRAPHS");
    
// -- one array for each main Section - 
    
subSection0 = new Array("zero""One""Two""Three""Four""Five");
    
// --
    // --
    // -- build the main buttons
    
for (i=0i<mainSections.lengthi++) {
        
attachMovie("mainButton""main"+ii+100);
        
myButton this["main"+i];
        
myButton.subs this["subSection"+i];
        
myButton.button.value mainSections[i];
        
myButton._x myButton._width*i;
        
// -- build subsection buttons for each main button
        
for (x=0x<myButton.subs.lengthx++) {
            
myButton.attachMovie("subButton""sub"+xx);
            
mySub myButton["sub"+x];
            
mySub.button.value myButton.subs[x];
            
mySub.button.outYpos myButton._height+(mySub._height*x);
        }
    }
    
// -- function that opens the subsection on rollover
    
function openSubs (target) {
        for (
i=0i<this[target].subs.lengthi++) {
            
subMenuCounter 0;
            
this[target]["sub"+i].button.newY this[target]["sub"+i].button.outYpos;
            
currentOpen target;
        }
    }
    
// -- close subsections function
    
function closeSubs (target) {
        for (
i=0i<this[target].subs.lengthi++) {
            
this[target]["sub"+i].button.newY this[target]["sub"+i].button.oYpos;
        }
    }
    
// - this is the function you would change to load content, or add more functionality to the buttons
    
function doSubSection (targetsub) {
                
myButton["sub"+1].onRelease = function() {
        
_root.contents.loadMovie("gallery_drawings.swf")
        }
    }
}
onClipEvent (enterFrame) {
    
// -- a timer that closes the menus after a certain amount of time
    
subMenuCounter++;
    if (
subMenuCounter>100) {
        
closeSubs(currentOpen);
        
subMenuCounter 0;
    }
}
onClipEvent (mouseUp) {
    
// -- this closes the curently open submenu if the user clicks outside of the menu
    
if (!this.hitTest(_root._xmouse_root._ymouse)) {
        
closeSubs(currentOpen);        
    }




Über Subbutton "One" lade ich bereits ein externes swf ein:
(Auszug aus oben abgebildeten Code)
PHP-Code:
        myButton["sub"+1].onRelease = function() {
        
_root.contents.loadMovie("gallery_drawings.swf"
klappt auch alles prima.
Problem aber: ich muss zweimal draufklicken, damit das swf geladen wird.

Wie kann das sein?
Auf den Subbuttons liegt übrigens ein Rollovereffekt in Form einer Schaltfläche. Wenn ich auf den Subbutton 1 zum ersten Mal klicke, ist die Rollover-schaltfläche noch sichtbar und nichts wird geladen.
Beim zweiten Klick ist die Rollover-Schaltfläche über dem Subbutton verschwunden und der Button lädt das externe swf.


Wie kann das sein? Warum macht diese Rollover-Schaltfläche Probleme und verschwindet nach dem 1.Klick plötzlich?
Vielen dank im Voraus für eure Hilfe!

Bixi.
Bixi ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 08:48 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele