vue [FlashCS5/AS3] Loader
Kommunauty
Connexion
Inscription

[FlashCS5/AS3] Loader


Eriam Messages : 47

Bonjour !

Suite au tuto ici :

http://www.kommunauty.fr/article-313-flash-creer-un-loader#com

J'essais en vain de créer un VRAI loader pour mon site en flash... Sauf que c'est un vrai malheur qui s'abat sur moi : impossible de réussir malgré la tonne de tuto que j'ai essayé...

Celui du tuto a l'air de fonctionné mais n'est pas en AS3... il est en AS2.

N'ayant aucune connaissance de l'Action Script (peu importe sa version) je galère vraiment !

Y aurait-il qualqu'un pour me traduire ce code pour AS3 ?

Ou créer un version qui fonctionne sous AS3 ?

lundi 21 janvier 2013

Deleted Messages : 200

Bonsoir,

Je ne code pas sous AS3 mais je te conseille d'aller faire un tour sur CodeCanyon

J'y ai trouvé ça par exemple ! C'est un loader assez sympa mais ce n'est pas une "barre de chargement"

vendredi 25 janvier 2013

Dawlin Messages : 3381

Ah, je ne code pas en AS3 donc je ne pourrait pas t'aider, désolé

Par contre ça ne devrait pas être super difficile à traduire une fois que tu maîtrisera un peu les bases de l'AS3 toi même

mardi 29 janvier 2013

Eriam Messages : 47

@Dawlin J'ai envie d'apprendre ce langage mais je doit rendre mon projet de TPE en l’occurrence ce site la semaine prochaine !

Voici ce que j'ai trouver recemment :

Flash CS5/6 implémente un loader qui sont des "...." en répétition NATIVEMENT dans chaque projet !

J'ai reussi a accéder au fichier en question, et voici le code :


// avoid accessing the stage if it is not your immediate parent
// to prevent security sandbox errors with content loaded across domains
var myStageWidth:int, myStageHeight:int;
var mainTimelineisplayObjectContainer = this;
try {
// go up to the Loader
if (mainTimeline.parent != null) {
mainTimeline = mainTimeline.parent;
}
// go up to the parent of the Loader
if (mainTimeline.parent != null) {
mainTimeline = mainTimeline.parent;
}
if (mainTimeline is Stage) {
myStageWidth = stage.stageWidth;
myStageHeight = stage.stageHeight;
} else {
myStageWidth = mainTimeline.loaderInfo.width;
myStageHeight = mainTimeline.loaderInfo.height;
}
} catch (se:SecurityError) {
if (mainTimeline != null) {
myStageWidth = mainTimeline.loaderInfo.width;
myStageHeight = mainTimeline.loaderInfo.height;
}
}

// center animation in the middle of the stage
anim_mc.x = (myStageWidth) / 2 - (anim_mc.width / 2);
anim_mc.y = (myStageHeight) / 2 - (anim_mc.height / 2);

/*
 * If defined, this function is called when there is some
 * error downloading one or more RSLs. If you do not define
 * this function, then the loader will attempt to load your
 * main content even though some RSLs failed. If you want
 * your main content to be loaded, then call the callback
 * function provided (as the sample implementation does.)
 * Another option may be to go to some error state in
 * your loading animation and NOT load the main content.
 * This implementation simply traces out the error information
 * to help debug problems while developing.
 */
function handleRSLError(callback:Function, numComplete:int, numFailed:int, failedURLs:Array):void {
trace("rsl error!");
trace("numComplete " + numComplete);
trace("numFailed " + numComplete);
trace("numComplete " + numComplete);
trace("failedURLs:");
for (var i:int = 0; i < failedURLs.length; i++) {
trace("  " + failedURLs[i]);
}
callback();
}

/*
 * If your animation needs time to complete once the RSLs are
 * loaded (progress bar go to 100% for example). Then you can
 * implement this method. The loading animation will remain
 * visible and the real content will not be loaded until
 * you call the callback function passed in. In the example
 * below, you would just need to add the code
 *    if (readyCallback!= null) readyCallback();
 * in the key frame in which your animation is complete.
 */
/*
var readyCallback:Function = null;
function handleRSLComplete(callback:Function):void {
readyCallback = callback;
}
*/

/*
 * This function can in general be useful if you want to set
 * any properties on the RSLPreloader or if you want to
 * listen to any events that it dispatches. Please note
 * that the code below, which sets debugWaitTime, should
 * NEVER be included in any completed project as it will
 * force a delay before the loader even attempts to download
 * any RSL files. It is mostly useful in development, to
 * force your loading animation to display.
 */
 /*
function setRSLPreloader(o:Object):void {
o.debugWaitTime = 5000;
}
*/

Si on pouvait me le traduire pour que je puisse mettre une barre de chargement a la place des "...." en boucle ! Je crois qu'il faut activé le code du bas mais j'ai pas tout compris et je ne sait pas non plus ce que je remplace par le nom de ma barre... Bref ! vous êtes mes ultime espoirs !

(Je suis aller sur le site du zero chercher le l'aide mais labas il pense que tout est sur "GOOGLE" et ne comprenne pas que l'on a déjà chercher avant de les voirs...)

En écrivant ceci j'ai eu une idee mais je ne sait pas si c'est possible... Pourrait-on charger un SWF a partir de HTML 5 et y inclure une barre de chargement...en CSS3 ? hummm sa me parrait tordu...

J'en oublierais presque la politesse : Merci a vous deux !

mercredi 6 février 2013 (Dernière édition mercredi 6 février 2013)

Répondre Pour répondre, tu dois d'abord t'inscrire rapidement sur Kommunauty. Rejoins-nous vite !