Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 26-11-2003, 07:09   #1 (permalink)
flash4fun
 
Benutzerbild von cybermad
 
Registriert seit: Nov 2003
Ort: Bad Nauheim
Beiträge: 104
onPress bei neuem MovieClip

Moin, moin,

habe Problem und stehe auf dem Schlauch:
Ich versuche einen Film in einen leeren MC auf der Bühne zu laden und möchte eine onPress-Aktion zufügen.
Leider funktioniert das nicht.
Hier das Script:

this.onLoad=function(){

// Leeren MC erstellen...
_root.createEmptyMovieClip("Intro",1);

// Film in leeren MC laden...
_root.loadMovie("home.swf");

// Film zentriert auf der Bühne positionieren...
_root["Intro"]._x=(Stage.width/2)-230;
_root["Intro"]._y=(Stage.height/2)-215;

}

this.onEnterFrame=function(){
if (_root["Intro"]._width>0) {
delete this.onEnterFrame;
_root["Intro"].onPress = function() {
}

}
}

Hat jemand eine Idee wo mein Fehler liegt ?

Grüße an Euch

cybermad
cybermad ist offline   Mit Zitat antworten
Alt 26-11-2003, 07:55   #2 (permalink)
{flasher}
 
Benutzerbild von Majo
 
Registriert seit: Mar 2003
Ort: on water
Beiträge: 2.823
so klappts:
ActionScript:
  1. _root.createEmptyMovieClip("Intro",1);
  2. _root.Intro.loadMovie("deine.swf");
  3. _root.Intro._x=(Stage.width/2)-230;
  4. _root.Intro._y=(Stage.height/2)-215;
  5. _root.onEnterFrame=function(){
  6.     if (Intro._width>0) {
  7.         trace("ist da");
  8.         delete this.onEnterFrame;
  9.         Intro.onPress = function() {
  10.             trace("klappt");
  11.         }
  12.     }
  13. }
__________________
hang loose
Majo ist offline   Mit Zitat antworten
Alt 26-11-2003, 07:58   #3 (permalink)
flash4fun
 
Benutzerbild von cybermad
 
Registriert seit: Nov 2003
Ort: Bad Nauheim
Beiträge: 104
Super funktioniert !
Ich danke Dir ...

Grüße

cybermad
cybermad ist offline   Mit Zitat antworten
Alt 26-11-2003, 08:13   #4 (permalink)
flash4fun
 
Benutzerbild von cybermad
 
Registriert seit: Nov 2003
Ort: Bad Nauheim
Beiträge: 104
Sorry, hat doch nicht funktioniert,
aber für alle, die interessiert sind, hier eine mögliche Lösung, nachdem bei mir der Groschen doch' noch gefallen ist.
Trotzdem danke ...

_root.createEmptyMovieClip("container",1);
_root.container.createEmptyMovieClip("Intro",2);
_root.container.Intro.loadMovie("home.swf");
_root.container.Intro._x=(Stage.width/2)-230;
_root.container.Intro._y=(Stage.height/2)-215;

this.onEnterFrame=function(){
if (_root.container.Intro._width>0) {
_root.container.onPress = function() {
_root.container.removeMovieClip();
}
}
}

Viele Grüße

cybermad
cybermad ist offline   Mit Zitat antworten
Alt 26-11-2003, 08:19   #5 (permalink)
{flasher}
 
Benutzerbild von Majo
 
Registriert seit: Mar 2003
Ort: on water
Beiträge: 2.823
klar hats funktioniert
sind halt nur deine pfadproblem
__________________
hang loose
Majo 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 23:55 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele