Les accents en actionscript... Encore une fois...

jytest Messages postés 314 Date d'inscription dimanche 27 novembre 2005 Statut Membre Dernière intervention 22 décembre 2014 - 21 avril 2010 à 23:09
cs_Burnside Messages postés 1132 Date d'inscription mercredi 28 août 2002 Statut Membre Dernière intervention 6 mars 2020 - 22 avril 2010 à 10:46
Bonsoir à tous.

J'utilise Adobe flash cs4.

J'ai beau consulter des pages et des pages sur internet, aucune solution pour moi.

Dans le tableau "gallery_name", j'ai une valeur de tableau capricieuse. Je voudrais bien y voir "Lettrage véhicule", et j'y vois toujours "Lettrage vhicule"...
Le "é" s'est volatilisé !!!

Qui pourra m'aider ? Je mets ci-après le code.
Merci pour votre aide.

===
var photo_filename:Array = new Array();
var photo_thumbnail:Array = new Array();
var photo_description:Array = new Array();
var gallery_name:Array = new Array("Affiche, Flyer", "Invitation, Carte visite",
"Catalogue, Plaquette", "Annonce-presse",
"Packaging", "Lettrage véhicule");
var gallery_file:Array = new Array("galerie_creation01", "galerie_creation02",
"galerie_creation03", "galerie_creation04",
"galerie_creation05", "galerie_creation06");
var no_of_gallery:Number = gallery_name.length;
var folder:String = "photos/";
var total:Number;
var g:Number = 0;
var i:Number = 0;
var j:Number = 0;
var k:Number = 0;
var p:Number = 0;
var border_size:Number = 2.2;
var scrolling_speed:Number = 0.15; // 0.00 to 1.00
var cv:Number = 0;
var cv_old:Number = 0;
var onDrag:Boolean;
var xml:XML = new XML();

sub_button._visible = false;
tn_area._visible = false;
stop();

for( i = 0; i < no_of_gallery; i++ )
{
sub_button.duplicateMovieClip("sub_button" + i, i);
this["sub_button" + i]._x = sub_button._x;
this["sub_button" + i]._y = sub_button._y + (sub_button._height+5) * i;
this["sub_button" + i].label_txt = gallery_name[i];
this["sub_button" + i].no = i;
}
function changeGallery(no)
{
for( i = 0; i < no_of_gallery; i++ )
{
this["sub_button" + i].button_mc._visible = true;
this["sub_button" + i].graphic_bg1._visible = true;
this["sub_button" + i].graphic_bg2._visible = false;
}
this["sub_button" + no].button_mc._visible = false;
this["sub_button" + no].graphic_bg1._visible = false;
this["sub_button" + no].graphic_bg2._visible = true;

xml.load( gallery_file[no] + ".xml");
xml.ignoreWhite = true;
}
changeGallery(0); // set default gallery at first loading
xml.onLoad = function()
{
for( i = 0; i < total; i++ )
removeMovieClip(tn_group["tn"+i]);

tn_group.tn._visible = false;
var nodes = this.firstChild.childNodes;
total = nodes.length;

for( i = 0; i < total; i++)
{
photo_filename[i] = nodes[i].attributes.filename;
photo_thumbnail[i] = nodes[i].attributes.thumbnail;
photo_description[i] = nodes[i].attributes.description;
}
j k p = 0;
g++;
create_tn();
scroller();
play();
}
function create_tn():Void
{
for( i = 0; i < total; i++)
{
var t = tn_group.tn.duplicateMovieClip("tn"+i, i);
t.pic.loadMovie( folder + photo_thumbnail[i] );
t.tn_no = i;

t._x = j * 90;
t._y = k * 90;
j++;
if( i % 2 1 ) { j 0; k++; }

t.onEnterFrame = function()
{
var bytes_loaded:Number = this.pic.getBytesLoaded();
var bytes_total:Number = this.pic.getBytesTotal();
var percent:Number = 0;

this.bd._width this.bd._height 50;
this.bd._alpha = 20;
this.bd._x this.bd._y 15;

percent = Math.round( bytes_loaded / bytes_total * 100 );
if( percent != 100 && percent > 0)
this.info.text = percent + "%";
else
this.info.text = "0%";

if( percent == 100 )
{
this.info.text = "";
this.pic._x = (80 - this.pic._width) * 0.5 + border_size;
this.pic._y = (80 - this.pic._height)* 0.5 + border_size;
this.bd._alpha = 100;
this.bd._width = this.pic._width + border_size * 2;
this.bd._height = this.pic._height + border_size * 2;
this.bd._x = this.pic._x - border_size;
this.bd._y = this.pic._y - border_size;
}
}
t.onRollOver = function()
{
this.pic._alpha = 75;
}
t.onRollOut = function()
{
this.pic._alpha = 100;
}
t.onRelease = function()
{
p = this.tn_no;
play();
}
}
}
var theMenu:ContextMenu = new ContextMenu();
theMenu.hideBuiltInItems(); _root.menu = theMenu;
var item:ContextMenuItem = new ContextMenuItem("Created by www.flashmo.com", flashmo);
theMenu.customItems[0] = item;
function flashmo() { getURL("http://www.flashmo.com"); }
function scroller():Void
{
scroller_mc._y = scrollable_area_mc._y;
tn_group._y = tn_area._y;
sr = tn_area._height/tn_group._height;
scroller_mc._height = scrollable_area_mc._height * sr;
sd = scrollable_area_mc._height - scroller_mc._height;
cd = tn_group._height - tn_area._height;
cr = cd / sd;
tn_group.setMask(tn_area);

if( tn_group._height <= tn_area._height )
{
scroller_mc._visible scrollable_area_mc._visible false;
}
else
{
scroller_mc._visible scrollable_area_mc._visible true;
}
scroller_mc.onPress = function()
{
this.startDrag(false, this._x, scrollable_area_mc._y, this._x,
scrollable_area_mc._y + scrollable_area_mc._height - this._height + 1);
onDrag = true;
this.onEnterFrame = function()
{
new_y = tn_area._y + scrollable_area_mc._y*cr - this._y*cr;
cv = (new_y - tn_group._y) * scrolling_speed;
tn_group._y += cv;
if( onDrag false && cv_old cv )
delete this.onEnterFrame;
cv_old = cv;
}
}
scroller_mc.onRelease scroller_mc.onReleaseOutside function()
{
this.stopDrag();
onDrag = false;
}
}

jyd

3 réponses

cs_Burnside Messages postés 1132 Date d'inscription mercredi 28 août 2002 Statut Membre Dernière intervention 6 mars 2020
22 avril 2010 à 09:32
Slt,

Comme çà essaie :

1) Sauver ton XMl en UTF-8
2) regarde si tu as bien importé les accents dans la zone de texte qui affiche le texte.

Bàt,
Burnside.
..:: Enjoy living in hell ::..
<img alt="flash " src="http://userbarscity.armatronic.com/userbars/41.png" wi="" align="middle" border="0" height="20" hspace="0" vspace=
0
jytest Messages postés 314 Date d'inscription dimanche 27 novembre 2005 Statut Membre Dernière intervention 22 décembre 2014
22 avril 2010 à 10:13
Merci à toi...


Commençant à utiliser Flash CS4, quelquechose est en train de m'échapper...
Comment sauvegarder un code actionscript en xml et en UTF-8 ?
L'actionscript ne fait-il pas partie intégrante de Flash CS4 ?

A l'aide svp.


jyd
0
cs_Burnside Messages postés 1132 Date d'inscription mercredi 28 août 2002 Statut Membre Dernière intervention 6 mars 2020
22 avril 2010 à 10:46
re,

1) Pour le XMl c'est pas flash qui le sauve mais soit Notepad, dreamweaver ou textedit dans file save as tu précises UFT-8.

Bàt,
Burnside.

..:: Enjoy living in hell ::..
<img alt="flash " src="http://userbarscity.armatronic.com/userbars/41.png" wi="" align="middle" border="0" height="20" hspace="0" vspace=
0
Rejoignez-nous