Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Come controllare lo "SCONTRO" tra due clip

    Salve a tutti!!

    io possiedo due movieclip, uno "pallina" e l'altro "muro"

    "pallina" si muove, si muove,si muove finche non incotra il lato di "muro" che non è altro che un rettangolo.

    Come faccio a controllare con actionscript l'incontro tra le due clip? insomma come faccio una cosa del tipo:

    if ( pallina tocca muro){
    pallina._vattne++
    }

    spero di essere stato chiaro!

    grazie a tutti e buona programmazione

  2. #2
    Usage

    myMovieClip.hitTest(x, y, shapeFlag)
    myMovieClip.hitTest(target)

    Parameters

    x The coordinate of the hit area on the Stage.

    y The coordinate of the hit area on the Stage.

    The and coordinates are defined in the global coordinate space.

    target The target path of the hit area that may intersect or overlap with the instance specified by MovieClip. The target usually represents a button or text-entry field.

    shapeFlag A Boolean value specifying whether to evaluate the entire shape of the specified instance (true), or just the bounding box (false). This parameter can only be specified if the hit area is identified using x and y coordinate parameters.
    _______
    direttamente dalla reference di flash...

    nel tuo caso if(pallina.hitTest(muro)) alert("scontrati");
    _.·¯Th3ñ0b0d¥¯·._

    http://www.tinform.it 1st flash site

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.