vue Aide pour FLASH - Page 2
Kommunauty
Connexion
Inscription

Aide pour FLASH


Dawlin Messages : 3381

Je patiente 45 secondes que je puisse accédr au fichier et je te dis ça !

merci

45 secondes plus tard :

Toujours mauvais type de fichier, ça marche pas avec flash 8

mercredi 5 novembre 2008

rei_66 Messages : 550

comprend po poutant j'ai changer les paramètre de publication et e l'ai mis sur flash player 8...

oops ben ouais je peu pas changer la version maintenant que j'y pense ... c'est parceque je me sert de flash cs3.....

GGRrrr

perso je voie pas d'autre moyen....

mercredi 5 novembre 2008

Dawlin Messages : 3381

HAHA ! les paramètres de publication, comme le nom l'indique, c'est pour la publication. en gros c'est le .swf qui sera lisible avec flash PLAYER 8

jeudi 6 novembre 2008

rei_66 Messages : 550

yup j'ai compris...

dit tu pourras pas m'aider a faire un menu comme ce que je te l'ai monter sur flash...

c'est grave.. sa fait 2 semaine que je suis dessus et j'arrive pas a en faire un de bien.. A chaque fois il se trouve que je laisse des bugs...

ou faite je cherche a faire un menu comme tu la vue que l'orque tu clique sur le button il

.changera de page...(enfin il vas juste afficher un movie clip)

. Que lorque tu clique sur un autre button il revien a sa place et changera de page...

bon si tu pourras m'aider dessus se serai trop simpa..

parceque je deviens dingue avec se menu....

dit par contre je vien de trouver un moyen pour intéger dans ta bar défillante des container pour les photo et les txt tout en utilisant ta base de donné...

si tu veux je t'envoie mes codes...

vendredi 7 novembre 2008

Dawlin Messages : 3381

Envoie, envoie !

Bon alors un code simple (que je verifie si il marche dès que je vais sur mon ordi qui a flash) pour afficher plusieurs bouton qui changent de page :


/* Tu as sur ta page tes boutons, placés comme tu veux par code ou pas (pour les placer par code, reporte-toi à mon autre code avec ta mère qui suce des chameaux => ceci n'était pas le trait d'humour de ce post)
Tu as également un movieClip d'occurrence scène "pages", qui contient à chaque frame une nouvelle page, chargée dynamiquement ou non. en gros à chaque frame tu as une page différente */

//sur chacun de tes boutons tu met ça (c'est simple mais c'est con...)
on(release){
pages.gotoAndStop("le_pere-noyel_en_string")
}

/*si tu veux faire une transition par exemple le rectangle noir qui grandit et que quand il dégrandit on voit la nouvelle page, tu te fait ton clip du rectangle noir, à la fin tu mets le code  pour changer de page sur la dernière frame, et dans ton bouton tu l'appelle par code et tu lui inculque la variable pour qu'il sache quelle page changer. */

Je te fais un fla le plus vite possible.

Et vous qui n'avez pas pris le temps de lire ce code parceque vous ne le comprenez pas, vous avez raté le trait d'humour de ce post

samedi 8 novembre 2008

rei_66 Messages : 550

a na j'ai pas utiliser cette technique pour faire cette page..

nan c'est bon j'ai vue le bug et j'ai pu le corriger. Bon quelqu'un m'a aider a le faire....

c'était tout bète perso j'avais oublé de remomer les pages en action scripts......

bon voila pour toi tu voulait faire un truc en xml na.. des photo et de txt en meme temps je sais comment le faire.

c'est tout simple

1) alors crée 3 page holder sur ta page flash

2) voici les action scripts pour relier les container et le ficher xml

note: qu'il contient aussi des easing transition pour donner un aspect professionel mais aussi plus propre

//easing tweens
import mx.transitions.Tween;
import mx.transitions.easing.*;

//set menu arrows to invisible in the beginning
arrowUp_mc._visible = false;
arrowDown_mc._visible = false;

//------------------------------LOAD XML DATA

function loadXML(success) {
if (success) {
xmlNode = this.firstChild;
title = [];
date = [];
description = [];
main = [];
total = xmlNode.childNodes.length;
//for loop for each menu item
for (i=0; i<total; i++) {
title&#91;i&#93; = xmlNode&#46;childNodes&#91;i&#93;&#46;childNodes&#91;0&#93;&#46;firstChild&#46;nodeValue;
date&#91;i&#93; = xmlNode&#46;childNodes&#91;i&#93;&#46;childNodes&#91;1&#93;&#46;firstChild&#46;nodeValue;
description&#91;i&#93; = xmlNode&#46;childNodes&#91;i&#93;&#46;childNodes&#91;2&#93;&#46;firstChild&#46;nodeValue;
main&#91;i&#93; = xmlNode&#46;childNodes&#91;i&#93;&#46;childNodes&#91;3&#93;&#46;firstChild&#46;nodeValue;
}
//GET COLORS
originalMenuTitleColor = this&#46;firstChild&#46;attributes&#46;originalMenuTitleColor;
originalMenuDateColor = this&#46;firstChild&#46;attributes&#46;originalMenuDateColor;
currentMenuTitleColor = this&#46;firstChild&#46;attributes&#46;currentMenuTitleColor;
currentMenuDateColor = this&#46;firstChild&#46;attributes&#46;currentMenuDateColor;
mainTitleColor = this&#46;firstChild&#46;attributes&#46;mainTitleColor;

arrowOverColor = this&#46;firstChild&#46;attributes&#46;arrowOverColor;
arrowOutColor = this&#46;firstChild&#46;attributes&#46;arrowOutColor;
//color up arrow
arrowOut = new Color(arrowUp_mc);
arrowOut&#46;setRGB(arrowOutColor);
//color down arrow on rollout
arrowOut = new Color(arrowDown_mc);
arrowOut&#46;setRGB(arrowOutColor);

//GET DIMENSIONS
menuSpacing = Number(this&#46;firstChild&#46;attributes&#46;menuSpacing);
textHolderXStart = Number(this&#46;firstChild&#46;attributes&#46;textHolderXStart);
textHolderXFinish = Number(this&#46;firstChild&#46;attributes&#46;textHolderXFinish);
mainTextWidth = Number(this&#46;firstChild&#46;attributes&#46;mainTextWidth);
scrollbarX = Number(this&#46;firstChild&#46;attributes&#46;scrollbarX);

//create menu
createDates();
//load first menu item
loadText(0);
} else {
textHolder&#46;description_txt&#46;text = "Error loading XML file";
}
}
xmlData = new XML();
xmlData&#46;ignoreWhite = true;
xmlData&#46;onLoad = loadXML;
xmlData&#46;load("news&#46;xml");

//---------------------------------------------------

//create dateMenu movieclip which will hold the menu
this&#46;createEmptyMovieClip("dateMenu",this&#46;getNextHighestDepth());
//position the menu
dateMenu&#46;_x = 25;
dateMenu&#46;_y = 25;
//create a mask for the menu, so it hides the ones off screen
this&#46;createEmptyMovieClip("dateMenuMask",this&#46;getNextHighestDepth());
//attach the mask to the movieclip
dateMenuMask&#46;attachMovie("dateMask","dateMask",this&#46;getNextHighestDepth());
//position the dateMenuMask
dateMenuMask&#46;_x = 0;
dateMenuMask&#46;_y = 25;
//Apply the mask
dateMenu&#46;setMask(dateMenuMask);

currentDate = 0;
dateMenuStartY = 0;

//create the menu function
function createDates() {
for (i=0; i<total; i++) {
//create a button for each menu item
dateMenu&#46;attachMovie("dateHolder","a"+i,i);
//assign button
a = dateMenu&#91;"a"+i&#93;;
//apply a hit which will last till next button
//(No spaces in between - cleaner mouse transition while easing across)
a&#46;hit&#46;_height = menuSpacing;
//apply spacer
a&#46;_y = dateMenuStartY;
dateMenuStartY += menuSpacing;

//assign number for each menu item
a&#46;num = i;

//apply text for title and date
a&#46;title_txt&#46;autoSize = "left";
a&#46;date_txt&#46;autoSize = "left";
a&#46;title_txt&#46;text = title&#91;i&#93;;
a&#46;date_txt&#46;text = date&#91;i&#93;;

//on press functions
a&#46;onPress = function() {
//assign a current menu item
currentDate = this&#46;num;
//load menu item text
loadText(this&#46;num);
};
//on rollover function
a&#46;onRollOver = function() {
menuRollOver(this&#46;num);
};
//on rollout function
a&#46;onRollOut = function() {
menuRollOut();
};
//center menu between 0 and line
dateMenu&#46;_x = 100-(dateMenu&#46;_width/2);
//if menu is smaller than stage height, center menu vertically
if (dateMenu&#46;_height<400) {
dateMenu&#46;_y = (450/2)-(dateMenu&#46;_height/2);
//else set the menu at 25, and show arrows
} else {
dateMenu&#46;_y = 25;
arrowUp_mc&#46;_visible = true;
arrowDown_mc&#46;_visible = true;
}
//record number for arrows
recordNumber = 1;
}
}

//CREATE MAIN TEXT

function loadText(i) {
//remove scrollbar if showing from before
removeMovieClip(scrollbar);

//assign color for title
mainTitle = new Color(textHolder&#46;description_txt);
mainTitle&#46;setRGB(mainTitleColor);

//No color through ActionScript for the main text because
//it is html text, and if there are pictures and such, they
//would be colored as well&#46; To change the color of the main text
//either click on the text box and change it there, or because
//the XML uses CDATA tags, you can use the <font color="#color">
//tags within the XML

textHolder&#46;description_txt&#46;autoSize = "left";
textHolder&#46;main_txt&#46;autoSize = "left";
//set main text width according to the XML attributes
textHolder&#46;description_txt&#46;_width = mainTextWidth;
textHolder&#46;main_txt&#46;_width = mainTextWidth;
//assign the title and main text
textHolder&#46;description_txt&#46;text = description&#91;i&#93;;
textHolder&#46;main_txt&#46;htmlText = main&#91;i&#93;;

//text to be alpha 0 in beginning for fade in effect
textHolder&#46;_alpha = 0;

//fade text in
alphaTw = new Tween(textHolder, "_alpha", Strong&#46;easeInOut, 0, 100, 25, false);
//tween for text move in effect
sideTween = new Tween(textHolder, "_x", Strong&#46;easeInOut, textHolderXStart, textHolderXFinish, 25);

//if the text is longer than 400, apply a scroller
if (textHolder&#46;_height>400) {
scroller();
//else just center it on the page
} else {
textHolder&#46;_y = (450/2)-(textHolder&#46;_height/2);
}
}

//---------------MENU COLORS

this&#46;onEnterFrame = function() {
//for loop for each menu item
for (i=0; i<total; i++) {
//original menu title color
origTitle = new Color(dateMenu&#91;"a"+i&#93;&#46;title_txt);
origTitle&#46;setRGB(originalMenuTitleColor);
//original menu date color
origDate = new Color(dateMenu&#91;"a"+i&#93;&#46;date_txt);
origDate&#46;setRGB(originalMenuDateColor);
}
//current menu title color
currTitle = new Color(dateMenu&#91;"a"+currentDate&#93;&#46;title_txt);
currTitle&#46;setRGB(currentMenuTitleColor);
//current menu date color
currDate = new Color(dateMenu&#91;"a"+currentDate&#93;&#46;date_txt);
currDate&#46;setRGB(currentMenuDateColor);

};
//--------------------BUTTONS

currentPos = dateMenu&#46;_y;

//up arrow on release function
arrowUp_mc&#46;onRelease = function() {
//if not at the first menu item
if (recordNumber<>1) {
//slide up tween
slideUp = new Tween(dateMenu, "_y", Strong&#46;easeInOut, currentPos, currentPos+400, 25);
//record current position
recordNumber -= 10;
currentPos += 400;
}
};
//down arrow on release function
arrowDown_mc&#46;onRelease = function() {
//if not at the last menu item
if (recordNumber+9<total) {
//slide down tween
slideDown = new Tween(dateMenu, "_y", Strong&#46;easeInOut, currentPos, currentPos-400, 25);
//record current position
recordNumber += 10;
currentPos -= 400;
}
};

//ON ROLLOVER
arrowUp_mc&#46;onRollOver = function() {
//color up arrow on rollover
arrowOver = new Color(arrowUp_mc);
arrowOver&#46;setRGB(arrowOverColor);
};
arrowDown_mc&#46;onRollOver = function() {
//color down arrow on rollover
arrowOver = new Color(arrowDown_mc);
arrowOver&#46;setRGB(arrowOverColor);
};

//ON ROLLOUT
arrowUp_mc&#46;onRollOut = function() {
//color up arrow on rollout
arrowOut = new Color(arrowUp_mc);
arrowOut&#46;setRGB(arrowOutColor);
};
arrowDown_mc&#46;onRollOut = function() {
//color down arrow on rollout
arrowOut = new Color(arrowDown_mc);
arrowOut&#46;setRGB(arrowOutColor);
};

//---------------KEY LISTENER

//clearListener is called from the INDEX file when clicked on the
//"News" button&#46; This removes the old Key and Mouse listeners so that
//the listeners would not overlap&#46;
function clearListener() {
//For up/down arrow keys
Key&#46;removeListener(keyListener);
//For page scrolling
Mouse&#46;removeListener(mouseListener);
}

//key listener for up / down keys
var keyListener&#58;Object = new Object();
keyListener&#46;onKeyDown = function() {
//UP ARROW
if (Key&#46;getCode() == 38) {
//if not the first date menu item
if (currentDate>0) {
//load the date menu item main text
loadText(currentDate-1);
//record position
currentDate--;
//if not the first overall and the first on a next page&#46;&#46;&#46;
if (currentDate+1<recordNumber && recordNumber<>1) {
//slide up tween
slideUp = new Tween(dateMenu, "_y", Strong&#46;easeInOut, currentPos, currentPos+400, 25);
//record the position
recordNumber -= 10;
currentPos += 400;
}
}
}
//DOWN ARROW        
if (Key&#46;getCode() == 40) {
//if not the last menu item
if (currentDate<(total-1)) {
//load the date menu item main text
loadText(currentDate+1);
//record position
currentDate++;
//if the last menu item on page
if (currentDate+1>recordNumber+9) {
//slide down tween
slideDown = new Tween(dateMenu, "_y", Strong&#46;easeInOut, currentPos, currentPos-400, 25);
//record the position
recordNumber += 10;
currentPos -= 400;
}
}
}
};
Key&#46;addListener(keyListener);


//--------------------DATE MENU ROLLOVER/ROLLOUT

//mouse rollover for each menu item
function menuRollOver(mc) {
for (i=0; i<total; i++) {
//alpha 50 for all menu items
dateMenu&#91;"a"+i&#93;&#46;_alpha = 50;
//alpha 100 for highlighted menu item
dateMenu&#91;"a"+mc&#93;&#46;_alpha = 100;
}
}
//mouse rollout for each menu item
function menuRollOut() {
for (i=0; i<total; i++) {
dateMenu&#91;"a"+i&#93;&#46;_alpha = 100;
}
}

//--------------------SCROLLER

function scroller() {
//set the main text at y=25
textHolder&#46;_y = 25;
//attach scrollbar
this&#46;attachMovie("scrollbar","scrollbar",this&#46;getNextHighestDepth());
//fade in scrollbar
alphaScrollbar = new Tween(scrollbar, "_alpha", Strong&#46;easeInOut, 0, 100, 15, false);
//position scrollbar
scrollbar&#46;_y = 25;
scrollbar&#46;_x = scrollbarX;

//on press function
scrollbar&#46;scrollbarBtn&#46;onPress = function() {
//user is only able to drag on the scrollbar background
this&#46;startDrag(false,scrollbar&#46;scrollbarBG&#46;_x,scrollbar&#46;scrollbarBG&#46;_y,scrollbar&#46;scrollbarBG&#46;_x,scrollbar&#46;scrollbarBG&#46;_height-this&#46;_height);
//Call scrollThumbs function for easing
textHolder&#46;onEnterFrame = scrollThumbs;
dragging = true;

};
//on release function
scrollbar&#46;scrollbarBtn&#46;onRelease = scrollbar&#46;scrollbarBtn&#46;onReleaseOutside=function () {
stopDrag();
dragging = false;
scrollbar&#46;scrollbarBtn&#46;gotoAndPlay("out");
delete this&#46;onEnterFrame;
};

scrollbar&#46;scrollbarBtn&#46;onRollOver = function() {
scrollbar&#46;scrollbarBtn&#46;gotoAndPlay("over");
};
scrollbar&#46;scrollbarBtn&#46;onRollOut = function() {
scrollbar&#46;scrollbarBtn&#46;gotoAndPlay("out");
};

//text easing function
function scrollThumbs() {
var easeText = -this&#46;_parent&#46;scrollbar&#46;scrollbarBtn&#46;_y*(((this&#46;_height-this&#46;_parent&#46;scrollbar&#46;scrollbarBtn&#46;_height)/(this&#46;_parent&#46;scrollbar&#46;scrollbarBG&#46;_height-this&#46;_parent&#46;scrollbar&#46;scrollbarBtn&#46;_height))-1);
// change &#46;2 for speed
this&#46;Y = (easeText-this&#46;_y+25)*&#46;2;
this&#46;_y += this&#46;Y;
if (Math&#46;abs(easeText-this&#46;_y)<1 && !dragging) {
delete this&#46;onEnterFrame;
}
}
// creating the mousewheel function

//When user uses the mouse wheel
var mouseListener&#58;Object = new Object();

mouseListener&#46;onMouseWheel = function(delta) {
//change the 4 for how much to scroll on single scroll
scrollbar&#46;scrollbarBtn&#46;_y -= delta*4;
if (scrollbar&#46;scrollbarBtn&#46;_y<0) {
scrollbar&#46;scrollbarBtn&#46;_y = 0;
}
if (scrollbar&#46;scrollbarBtn&#46;_y+scrollbar&#46;scrollbarBtn&#46;_height>400) {
scrollbar&#46;scrollbarBtn&#46;_y = 400-scrollbar&#46;scrollbarBtn&#46;_height;
}
//call ease text function
textHolder&#46;onEnterFrame = scrollThumbs;
};

// adding the listener to the Mouse object
Mouse&#46;addListener(mouseListener);
}

une fois fait tu doit cré tes fichier xml et tes ficher sourcer ou il vas récuperer les pics

bon voici les fichier sources

<a class="postlink" href="http://www.megaupload.com/?d=5WS5ZUE6">http://www.megaupload.com/?d=5WS5ZUE6</a>

sa vas plus t'aides

bon je l'ai fait en flash 8 mais perso change de version de flash et prend flash adobe cs4

parceque tou les tuto que je vais commence a faire pour kommunauty sera l'ad sus..

mercredi 12 novembre 2008

Dawlin Messages : 3381

Et je paye comment, avec mes dents ?

Bon sinon merci beaucoup pour le code le problème c'est que c'est gros et long, et que je vais devoir l'étudier pour l'adapter

Merci beaucoup quand même !

mercredi 12 novembre 2008

rei_66 Messages : 550

yup c'est vrai parceque il y en a plein de codes qui te sont pas nécesaire de dans...

comme la partie easing et les tweeking effects...

Mais j'ai un petit peu simplier les explications dans un autre post appel rei_66 pour les codes....

Hey maintenant que j'y pense suis pas un expert en code.... Bon c'est vraie je me débrouille un peu mais il y a encore plein d'autre truc que je connais po

dit tu t'y connais en CG. (Computer graphics)

plus connue sous le nom d'animation 3D

jeudi 13 novembre 2008

Dawlin Messages : 3381

Plus ou moins, rien de programmation 3D mais je touche un peu en Blender

jeudi 13 novembre 2008

rei_66 Messages : 550

et tu fait quoi en blender.....???

vendredi 14 novembre 2008

Page suivante »