Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 05-07-2004, 18:10   #1 (permalink)
Neuer User
 
Registriert seit: Jan 2004
Ort: bei Düsseldorf
Beiträge: 76
onMouseDown löst Aktion im Hauptfilm aus,obwohl es in einem extra MC steht

Hallo zusammen,
erstmal vorweg: Ich nutze MING um meine Swiffs zu erstellen.
Ich hab folgenden PHP zum testen erstellt und per PHP in MING "compiliert".
Soweit funktioniert das auch ganz gut. Mein Problem ist jetzt: Wenn
ich irgendwo im Flash Film Clicke,dann wird die Datei Test.html geöffnet.
Warum passiert das nicht nur,wenn ich im MC "btn" clicke? Gibt es eine bessere Möglichkeit in ActionScript Buttons zu erstellen?

Danke schonmal,
SIGINT

Code:
<?
ming_setScale(20.00000000);
ming_useswfversion(6);
$movie = new SWFMovie();
$movie->setDimension(550,400);
$movie->setBackground(0xcc, 0xcc, 0xcc );
$movie->setRate(31);// mx actionscript


$strAction ="
_root.createEmptyMovieClip('someshapes', 9);
_root.createEmptyMovieClip('mt', 2);
_root.createEmptyMovieClip('btn', 3);

_root.btn.setBackground(0xcc,0x00,0xcc);

with(_root.btn)
{
lineStyle(2, 0x00ee00, 100); 
    beginFill(0x00cc00, 50);
    moveTo(0,0);
    lineTo(100,0);
    lineTo(100, 100);
    lineTo(0,100);
    endFill();
    onMouseDown=function(){_root.getURL('test.html');};
_width=100;
_height=100;
}

with (_root.someshapes) {
    lineStyle(2, 0x00ee00, 100); 
    beginFill(0x00cc00, 50);
    moveTo(0,0);
    lineTo(200, 150);
    lineTo(80, 210);
    endFill();
    lineStyle(3, 0x00eeee, 30);
    beginFill(0x0000cc, 60);
    moveTo(180, 130);
    curveTo(200, 80, 250, 70);
    curveTo(200, 10, 40, 90);
    endFill();
    
}
_root.onMouseOver=Mouse.hide();

_root.mt.startDrag(true);
_root.createTextField('textf',0,400,0,40,20);
_root.textf.maxChars=30;
_root.textf.type='static';

";

$movie->add(new SWFAction(str_replace("\r", "", $strAction)));
$movie->nextFrame();

$strAction2="
_root.textf.text=_root.mt._x;
_root.someshapes._x=this.mt._x;
_root.someshapes._y=this.mt._y;
";

$movie->add(new SWFAction(str_replace("\r", "", $strAction2)));
$movie->nextFrame();
$movie->add(new SWFAction("gotoAndPlay(2);"));
$movie->nextFrame();
header('Content-type: application/x-shockwave-flash');
$movie->output(4);
?>
sigint ist offline   Mit Zitat antworten
Alt 05-07-2004, 19:18   #2 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
PHP-Code:
this.onMouseDown = function() {
    if (
this.hitTest(_root._xmouse_root._ymouse)) {
        
trace("bingo");
    }
}; 
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake ist offline   Mit Zitat antworten
Alt 06-07-2004, 08:20   #3 (permalink)
Neuer User
 
Registriert seit: Jan 2004
Ort: bei Düsseldorf
Beiträge: 76
Ich kann dieses "with (irgendwas) {}" nicht leiden. Wenn ich dein Script in die "with - Umgebung" stelle,dann Funktioniert nichts, aber folgendes läuft perfekt:
Code:
_root.btn.onMouseDown = function() {
    if (_root.btn.hitTest(_root._xmouse, _root._ymouse)) {_root.getURL('test.html');}
};
Danke für die Hilfe,
SIGINT
sigint 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:53 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele