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

    richiamare una funzione

    Ciao a tutti chi mi sa spiegare come faccio a richiamare una funzione.
    Dunque ho un pulsante che dovrebbe richiamare questo script:

    onClipEvent (load) {
    function window(x,y,w,h) {
    newx = x;
    newy = y;
    neww = w;
    newh = h;
    }
    }

    onClipEvent (load) {
    newWin = new window(390,230,300,300);
    }

    onClipEvent (enterFrame) {
    speed = 10;
    basew = this._width;
    baseh = this._height;
    difw = neww-basew;
    difh = newh-baseh;
    setProperty(this, _width, basew+(difw/speed));
    setProperty(this, _height, baseh+(difh/speed));

    if (basew >= neww-1 and basew <= neww+1) {
    setProperty(this, _width, neww);
    }
    if (baseh >= newh-1 and baseh <= newh+1) {
    setProperty(this, _height, newh);
    }
    }

    onClipEvent (enterFrame) {
    posx = this._x;
    posy = this._y;
    difx = newx-posx;
    dify = newy-posy;
    setProperty(this, _x, posx + (difx/speed));
    setProperty(this, _y, posy + (dify/speed));

    if (posx >= newx - 1 and posx <= newx + 1) {
    setProperty(this, _x, newx);
    }
    if (posy >= newy - 1 and posy <= newy + 1) {
    setProperty(this, _y, newy);
    }
    }

    ho già provato a scrivere:

    on (release) {
    _root.nomeclip.window(390,230,300,300);
    }
    ..ma nulla non funziona qualcuno mi sa dire perchè?
    grazie mille!

  2. #2
    Utente di HTML.it L'avatar di 7vite
    Registrato dal
    Mar 2001
    Messaggi
    3,407
    Solitamente si mette la function nella root (in un keyframe sulla timeline principale) e non in un movieclip e la richiami come _root.nomefunzione(eventuali_parametri)

  3. #3
    bhooooo....:master:

    prova cosi

    onClipEvent (load) {
    function window(x,y,w,h) {
    newx = x;
    newy = y;
    neww = w;
    newh = h;
    }
    newWin = new window();
    }

    onClipEvent (load) {

    }

    onClipEvent (enterFrame) {
    if(ok){
    speed = 10;
    basew = this._width;
    baseh = this._height;
    difw = neww-basew;
    difh = newh-baseh;
    posx = this._x;
    posy = this._y;
    difx = newx-posx;
    dify = newy-posy;
    setProperty(this, _x, posx + (difx/speed));
    setProperty(this, _y, posy + (dify/speed));
    if (posx >= newx - 1 and posx <= newx + 1) {
    setProperty(this, _x, newx);
    }
    if (posy >= newy - 1 and posy <= newy + 1) {
    setProperty(this, _y, newy);
    }
    setProperty(this, _width, basew+(difw/speed));
    setProperty(this, _height, baseh+(difh/speed));

    if (basew >= neww-1 and basew <= neww+1) {
    setProperty(this, _width, neww);
    }
    if (baseh >= newh-1 and baseh <= newh+1) {
    setProperty(this, _height, newh);
    }
    }
    }

    e nel pulsante

    on (release) {
    _root.pino.ok=true;
    _root.pino.window(390,230,300,300);
    }

    il nome istanza del movie è pino

    non stai parlando di finestre da browser vero..
    conosco poco di programmazione, equel poco ...lo uso pure malee

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.