MouseEvent auf mobilen Geräten [Flash CS5]
| Beiträge: 4 Registriert: May 2011
| 16.05.2011, 11:10
Hallo Leute,
ich bin fast am Verzweifeln: ich möchte einfach Koordinaten abfragen, um eine Signatur auf einem mobilen Gerät zu erstellen. Dazu habe ich die entsprechede Flash-Datei im Device Central erstellt und per AS Code (was ja auf den desktop funktionierte) diese Koordinaten abgefragt und per Zeichenfunktionen verbunden. Ich weiß auch, dass ich eher "cacheAsBitmap()" verwenden sollte, aber primär kann ich erstmal keine Interaktion auf Android 2.2 in meinem Flash (in HTML integriert) handeln.
Ein Blick in die Doku sagte mir, es gibt seit FlashPlayer 10.1 die Möglichkeit, TouchEvents zu verarbeiten. leider funktionieren die auch auf meinem Gerät nicht (HTC, kapazitives Display).
Hier noch das ganz simle Script zu der Signatur:
PHP:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
// Teste
this.my_txt.text = "Mouse Koordinaten: n";
//
this.my_txt.text = this.my_txt.text + "X-Startposition(jetzt) :" + this._xmouse + "Y-Startposition(jetzt) :" + this._ymouse + "n";
this.createEmptyMovieClip("draw_mc", 10);
this.draw_mc.lineStyle(2.5, "0x333333");
this.onMouseDown = function()
{
_root.draw_mc.moveTo(this._xmouse, this._ymouse);
this.onEnterFrame = function()
{
this.my_txt.text = this.my_txt.text + "X-Position :" + this._xmouse + " - ";
this.my_txt.text = this.my_txt.text + "Y-Position :" + this._ymouse + "n";
_root.draw_mc.lineTo(this._xmouse, this._ymouse);
this.my_txt.scroll += this.my_txt.maxhscroll;
};
updateAfterEvent();
};
this.onMouseUp = function()
{
delete this.onEnterFrame;
}
this.clear_btn.onRelease = function() {
_root.draw_mc.removeMovieClip();
my_txt.text = "";
_root.createEmptyMovieClip("draw_mc", 10);
_root.draw_mc.lineStyle(2.5, "0x333333");
_root.my_txt.text = _root.my_txt.text + "X-NeuStart :" + _root._xmouse + "Y-NeuStart :" + _root._ymouse + "n";
}
|
| | | Beiträge: 147 Wohnort: Qo'noS Registriert: Nov 2009
| 16.05.2011, 17:05
|
|