J'ai un projet dont j'ai besoin de mettre à jour le formulaire AS2 vers AS3 car j'ai besoin de certaines des nouvelles fonctions disponibles pour le centrage vertical du texte.Besoin d'aide avec la conversion Flash AS2 vers AS3, ayant des problèmes majeurs
Mon code AS2 actuel sur la ligne de temps est le suivant.
var dataField = _root.dataField;
var dataType = _root.dataType;
var dataPage = _root.dataPage;
var dataVar = _root.dataVar;
_root.mc.onRelease = function() {
getURL("index.php?page="+dataPage+"&num="+dataNum+"&"+dataType+"="+dataVar, "_self");
};
Et mon fichier AS externe est comme suit.
import mx.transitions.Tween;
/**
*
* StandardKey is attached to a movieclip in the library.
* It handles the basic button behavior of the keyboard keys.
* When each button is placed on the stage, it's instance name
* will be the unique ID of the key.
*
*/
class StandardKey extends MovieClip {
///////////////////////////////////////
//Stage Elements
var highlight:MovieClip;
//End Stage Elements
var highlightTween:Tween;
function StandardKey(Void) {
//Repaint the key with 0 alpha
highlight._alpha = 0;
}
function onPress(Void):Void {
//Do the highlight animation
highlightTween.stop();
highlightTween = new Tween(highlight, "_alpha", mx.transitions.easing.Regular.easeInOut, 100, 0, 10, false);
}
}
Voici ma tentative de chronologie en mouvement et AS2 externe à AS3
Timeline i maintenant:
var dataField = this.dataField;
var dataType = this.dataType;
var dataPage = this.dataPage;
var dataVar = this.dataVar;
var dataNum = this.dataNum;
_root.mc.onRelease = function() {
navigateToURL(new URLRequest("index.php?page="+dataPage+"&num="+dataNum+"&"+dataType+"="+dataVar, "_self"));
};
AS3 externe i ont
package {
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.display.MovieClip;
/**
*
* StandardKey is attached to a movieclip in the library.
* It handles the basic button behavior of the keyboard keys.
* When each button is placed on the stage, it's instance name
* will be the unique ID of the key.
*
*/
public class StandardKey extends MovieClip {
///////////////////////////////////////
//Stage Elements
var highlight:MovieClip;
//End Stage Elements
var highlightTween:Tween;
public function StandardKey(Void) {
//Repaint the key with 0 alpha
highlight._alpha = 0;
}
public function onPress(Void):void {
//Do the highlight animation
highlightTween.stop();
highlightTween = new Tween(highlight, "_alpha", fl.transitions.easing.Regular.easeInOut, 100, 0, 10, false);
}
}
}
Les erreurs i am obtenir actuellement sont:
Scène 1, Couche 'Etiquette', Cadre 1, Ligne 6 1120: Accès à la propriété non définie _root. Scène 1, Calque 'Étiquette', Image 1, Ligne 7 1137: Nombre incorrect d'arguments. Attendu pas plus de 1.
Si quelqu'un pouvait m'aider à résoudre ce problème, je l'apprécierais beaucoup.
Sincères salutations Mat.
Je ne suis pas vraiment sûr de ce que vous demandez - Il peut être utile si vous postez les erreurs que vous obtenez, ou le code que vous avez essayé en AS3, afin que nous puissions aider comprendre où vous allez mal. – quoo
Salut Quoo j'ai ajouté ce que j'ai actuellement à la fin du message original, j'espère que c'est plus instructif.Merci :) – Mat