Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 28-02-2007, 11:02   #1 (permalink)
.posten < lesen.
 
Registriert seit: Nov 2001
Ort: Bremen
Beiträge: 62
hitTest Kollisionsabfrage

Hallo,

Mit einer hitTest-Abfrage möchte ich erreichen, dass der Stift sich nur in dem „move_area_mc“ bewegen kann. Zusätzlich soll sich synchron das rechte Objekt („rechts_mc“) nach links oder rechts bewegen!

Wäre super wenn ihr mir da weiterhelfen könntet!

Gruß
Spektrum

ActionScript:
  1. //-- Fläche für den hitTest
  2. content_mc.move_area_mc._visible = false;
  3.  
  4. content_mc.rechts_mc.onPress = function() {
  5.    
  6.     //-- Abstände Maus-Klick zu Objekten
  7.     xOffsetBody = _root._xmouse - this._x;
  8.     xOffsetStift = _root._xmouse - this._parent.stift_mc._x;
  9.     yOffsetStift = _root._ymouse - this._parent.stift_mc._y;
  10.  
  11.     this.onEnterFrame = function() {
  12.        
  13.         //-- Objekte draggen
  14.         //this._x = _root._xmouse - xOffsetBody;
  15.         this._parent.stift_mc._x = _root._xmouse - xOffsetStift;
  16.         if (this._parent.stift_mc.hitTest (this._parent.move_area_mc)) {
  17.             this._parent.stift_mc._y = _root._ymouse - yOffsetStift;
  18.         }
  19.     }
  20. }
  21.  
  22. content_mc.rechts_mc.onRelease = function() {
  23.     delete this.onEnterFrame;
  24. }
  25.  
  26. content_mc.rechts_mc.onReleaseOutside = function() {
  27.     delete this.onEnterFrame;
  28. }
Angehängte Dateien
Dateityp: zip hitTest-Test.zip (9,3 KB, 6x aufgerufen)
Spektrum 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 16:21 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele