mouvement par actionscript

  • buzzby365
  • Proficient
  • Proficient
  • No Avatar
  • Inscription: Mai 14, 2004
  • Messages: 288
  • Status: Offline

Message Novembre 4th, 2004, 2:22 am

j'ai ce code pour déplacer un clip à partir du point un au point b . cela fonctionne bien, aucun problème du tout avec le mouvement. Je suis le problème est d'avoir à préciser ce point a est. le code me permet de prédéfinir quel point b sera. Je peux dire ce que le x et Y coords sera pour cela, mais je ne peux pas dire quel est le point un et Y coords Wil être

étape par étape pour le mouvement est ci-dessous:

ajouter du code au MovieClip

Code: [ Select ]
onClipEvent(load)
frict = .2
ratio = .1
turnSp = xSp = ySp = xScSp = yScSp = 0
turnEnd = _parent.turnEnd
xEnd = _parent.xEnd
yEnd = _parent.yEnd
xscaleEnd = _parent.xscaleEnd
yscaleEnd = _parent.yscaleEnd


onClipEvent(enterFrame)
turnSp = turnSp*frict+(turnEnd-_rotation)*ratio
xSp = xSp*frict+(xEnd-_x)*ratio
ySp = ySp*frict+(yEnd-_y)*ratio
xScSp = xScSp*frict+(xscaleEnd-_xscale)*ratio
yScSp = yScSp*frict+(yscaleEnd-_yscale)*ratio
this._x += xSp
this._y += ySp
this._rotation += turnSp
this._xscale += xScSp
this._yscale += yScSp
  1. onClipEvent(load)
  2. frict = .2
  3. ratio = .1
  4. turnSp = xSp = ySp = xScSp = yScSp = 0
  5. turnEnd = _parent.turnEnd
  6. xEnd = _parent.xEnd
  7. yEnd = _parent.yEnd
  8. xscaleEnd = _parent.xscaleEnd
  9. yscaleEnd = _parent.yscaleEnd
  10. onClipEvent(enterFrame)
  11. turnSp = turnSp*frict+(turnEnd-_rotation)*ratio
  12. xSp = xSp*frict+(xEnd-_x)*ratio
  13. ySp = ySp*frict+(yEnd-_y)*ratio
  14. xScSp = xScSp*frict+(xscaleEnd-_xscale)*ratio
  15. yScSp = yScSp*frict+(yscaleEnd-_yscale)*ratio
  16. this._x += xSp
  17. this._y += ySp
  18. this._rotation += turnSp
  19. this._xscale += xScSp
  20. this._yscale += yScSp



maintenant définir les paramètres pour l'interpolation dans le scénario principal
(Sur un cadre ou la touche d'action)

Code: [ Select ]
xEnd=475
yEnd=300
turnEnd=180
xscaleEnd = 120
yscaleEnd = 200
  1. xEnd=475
  2. yEnd=300
  3. turnEnd=180
  4. xscaleEnd = 120
  5. yscaleEnd = 200


voir le problème?

i don't. aimerait un peu d'aide sur ce s'il vous plaît!
  • Anonymous
  • Bot
  • No Avatar
  • Inscription: 25 Feb 2008
  • Messages: ?
  • Loc: Ozzuland
  • Status: Online

Message Novembre 4th, 2004, 2:22 am

Afficher de l'information

  • Total des messages de ce sujet: 1 message
  • Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 42 invités
  • Vous ne pouvez pas poster de nouveaux sujets
  • Vous ne pouvez pas répondre aux sujets
  • Vous ne pouvez pas éditer vos messages
  • Vous ne pouvez pas supprimer vos messages
  • Vous ne pouvez pas joindre des fichiers
 
 

© 2011 Unmelted, LLC. Ozzu® est une marque déposée de Unmelted, LLC