PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Graphisme & Infographie > macromedia.flash > how to get x and y values of a movable movie symbol?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
how to get x and y values of a movable movie symbol?

Réponse
 
LinkBack Outils de la discussion
Vieux 26/05/2008, 02h09   #1
Dr Vangeldor
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut how to get x and y values of a movable movie symbol?

Can someone give me some clues on how to get the x and y location of a movie
symbol that can be
moved by user around the screen? I am aware of using _xmouse and _ymouse
properties to get the mouse
coordinates but how can i get the x and y coordinates of a movable movie
symbol? I assume i want the coordiates of its registration center coordinates.
Any code hints or tips would be appreciated. I am lost on this one.
thanks

  Réponse avec citation
Vieux 26/05/2008, 02h21   #2
ggshow
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to get x and y values of a movable movie symbol?

_x & _y
  Réponse avec citation
Vieux 26/05/2008, 02h48   #3
Dr Vangeldor
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to get x and y values of a movable movie symbol?

what are you trying yo say?
  Réponse avec citation
Vieux 26/05/2008, 02h49   #4
Dr Vangeldor
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to get x and y values of a movable movie symbol?

what are you trying to say?
  Réponse avec citation
Vieux 26/05/2008, 11h17   #5
Noelbaland
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to get x and y values of a movable movie symbol?

If you are using Actionscript 3 you should

1) Use event listeners to detect mouse-down and mouse-up events on the
movieclip.
2) Set up functions to drag and drop the movieclip.
3) In the drop function get the x and y position of the movieclip and
4) trace it out or put the values into dynamic textfields.

Here's a simple example. The code is on the first frame of the timeline

myMC.addEventListener(MouseEvent.MOUSE_DOWN, startDragSquare);
myMC.addEventListener(MouseEvent.MOUSE_UP, stopDragSquare);

function startDragSquare(evt:MouseEvent):void
{
this.startDrag();
}

function stopDragSquare(evt:MouseEvent):void
{
this.stopDrag();
var xpos = this.x;
var ypos = this.y;

trace ("X: "+xpos+", Y: "+ypos);
}

  Réponse avec citation
Vieux 27/05/2008, 07h16   #6
Dr Vangeldor
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to get x and y values of a movable movie symbol?

thank you Noelbaland
I will end up putting values in dynamic fields. I will have to study what you gave me and dynamic text fields to figure that out to.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 11h10.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,14592 seconds with 14 queries