Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
903 connectés 

  FORUM HardWare.fr
  Programmation
  Flash/ActionScript

  [as] mettre un swf à la place d'un texte dynamique ou dedans

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[as] mettre un swf à la place d'un texte dynamique ou dedans

n°1295337
sakuraba
Posté le 31-01-2006 à 10:48:22  profilanswer
 

bonjour,
 
ça fait un moment que je cherche mais je trouve pas  
je voudrais inserer mon photo.swf dans un texte dynamique qui est dans un autre swf ( test.swf) sans niké la mise en page e n cliquant sur le bouton galerie  
 
 
voici mon photo.swf
http://s500.free.fr/pires/villa/photo.swf
 
voici mon test.swf
http://s500.free.fr/pires/body/fr/test.swf
 


---------------
Newsletter RCZ : inscriptions compliquées ou réceptions tardives ? Mon blog la partage sans délai. C est ici que ça se passe : https://gravelparis.com/
mood
Publicité
Posté le 31-01-2006 à 10:48:22  profilanswer
 

n°1295452
mechkurt
Posté le 31-01-2006 à 12:42:57  profilanswer
 

bizarre on dirait que tu passes de Stage.ScaleMode = "NoScale"; à Stage.ScaleMode = "ShowAll";


---------------
D3
n°1295507
sakuraba
Posté le 31-01-2006 à 13:52:25  profilanswer
 

ouais c'est tres bizarre
en faite non lol  

Code :
  1. //Handle the UIScrollBar  - instance in library
  2. this.createClassObject(mx.controls.UIScrollBar, "my_sb", 40);
  3. // Set the target text field for the scroll bar.
  4. my_sb.setScrollTarget(leTexte);
  5. // Size it to match the text field.
  6. my_sb.setSize(23, leTexte._height);
  7. // Move it next to the text field.
  8. my_sb.move(leTexte._x+leTexte._width, leTexte._y);
  9. Accueil_fr();
  10. function Accueil_fr() {
  11. // définition de "txt" en tant qu'objet LoadVars.
  12. txt = new LoadVars();
  13. // chargement du fichier texte.
  14. txt.load("body/fr/Accueil_fr.txt" );
  15. //fonction lancée une fois le fichier chargé
  16. txt.onLoad = function(ok) {
  17.  if (ok) {
  18.   // assignation de chaque variable du fichier texte  
  19.   // à un champ de l'animation
  20.   titre_central.htmlText = this.titre;
  21.   leTexte.htmlText = this.texte;
  22.   titre_menu.htmlText = this.titre_menu;
  23.  } else {
  24.   // message d'erreur si le fichier n'a pas été chargé.
  25.   leTexte.htmlText = "Erreur: le fichier n'a pas été chargé";
  26.  }
  27. };
  28. }
  29. bouton_accueil.addEventListener("click", Accueil_fr);
  30. function Historique_fr() {
  31. // définition de "txt" en tant qu'objet LoadVars.
  32. txt = new LoadVars();
  33. // chargement du fichier texte.
  34. txt.load("body/fr/Historique_fr.txt" );
  35. //fonction lancée une fois le fichier chargé
  36. txt.onLoad = function(ok) {
  37.  if (ok) {
  38.   // assignation de chaque variable du fichier texte  
  39.   // à un champ de l'animation
  40.   titre_central.htmlText = this.titre;
  41.   leTexte.htmlText = this.texte;
  42.   titre_menu.htmlText = this.titre_menu;
  43.  } else {
  44.   // message d'erreur si le fichier n'a pas été chargé.
  45.   leTexte.htmlText = "Erreur: le fichier n'a pas été chargé";
  46.  }
  47. };
  48. }
  49. bouton_histoire.addEventListener("click", Historique_fr);
  50. function galerie_fr() {
  51. _root.createEmptyMovieClip("cadre", -1111);
  52. }
  53. bouton_galerie.addEventListener("click", galerie_fr);


Message édité par sakuraba le 31-01-2006 à 13:54:03

---------------
Newsletter RCZ : inscriptions compliquées ou réceptions tardives ? Mon blog la partage sans délai. C est ici que ça se passe : https://gravelparis.com/
n°1295510
sakuraba
Posté le 31-01-2006 à 13:56:00  profilanswer
 

a la place du

Code :
  1. _root.createEmptyMovieClip("cadre", -1111);


 
ça devrait etre le lien un truc du genre  

Code :
  1. this.leTexte.loadMovieNum("photo.swf",10);


 
pour que ça ouvre le photo.swf dans le texte dynamique "leTexte"
 
tu vois ce que je veux dire ??


---------------
Newsletter RCZ : inscriptions compliquées ou réceptions tardives ? Mon blog la partage sans délai. C est ici que ça se passe : https://gravelparis.com/
n°1295511
mechkurt
Posté le 31-01-2006 à 13:58:04  profilanswer
 

[:al zheimer]  
ah ouais quand même...
 :pt1cable:  
charger une anim Flash dans un textfield via un loadMovieNum c'est couillu...


---------------
D3
n°1295534
sakuraba
Posté le 31-01-2006 à 14:31:26  profilanswer
 

ou faire autre chose mais je veux que ce soit au même endroit  
tu proposes quoi comme piste


---------------
Newsletter RCZ : inscriptions compliquées ou réceptions tardives ? Mon blog la partage sans délai. C est ici que ça se passe : https://gravelparis.com/
n°1295573
mechkurt
Posté le 31-01-2006 à 15:16:15  profilanswer
 

ben tu peux mettre un swf dans untextfield au rendu html en utilisant la balise <img> (j'ai jamais essayé mais c'est possible)
pour un swf fait d'interpolation de mouvement a mon avis aucun PB par contre je vas reagir ton code actionscript (surtout si il est truffé de _root)
sinon ben tu charges dans un autre clip...


---------------
D3
n°1295603
sakuraba
Posté le 31-01-2006 à 15:44:10  profilanswer
 

tu pourrais me donner le code pour charger dans un autre clip exactement parce que je patinne depuis plusieurs jours


---------------
Newsletter RCZ : inscriptions compliquées ou réceptions tardives ? Mon blog la partage sans délai. C est ici que ça se passe : https://gravelparis.com/
n°1295690
mechkurt
Posté le 31-01-2006 à 16:52:36  profilanswer
 

Code :
  1. _root.createEmptyMovieClip("cadrevide_mc", 1000000);
  2. //version simple:
  3. _root.cadrevide_mc.loadMovie("photo.swf" );
  4. //version total control:
  5. var mclListener:Object = new Object();
  6. mclListener.onLoadInit = function(target_mc:MovieClip) {
  7.     trace("movie loaded" );
  8.     target_mc._x -= target_mc._width/2;
  9.     target_mc._y -= target_mc._height/2;
  10. }
  11. var swf_mcl:MovieClipLoader = new MovieClipLoader();
  12. swf_mcl.addListener(mclListener);
  13. swf_mcl.loadClip("photo.swf",  _root.cadrevide_mc);


 [:ab614]


---------------
D3
n°1295724
sakuraba
Posté le 31-01-2006 à 17:33:18  profilanswer
 

merci bcp ça marche mais pas pour mon fichier car c est du AS uniquement  
 

Code :
  1. import flash.filters.DropShadowFilter;
  2. var loadListener:Object = new Object();
  3. //--------------------------------
  4. import mx.transitions.*;
  5. import mx.transitions.easing.*;
  6. var mcl_obj:Object = new Object();
  7. //--------------------------------
  8. _global.SW = Stage.width;
  9. _global.SH = Stage.height;
  10. _global.SWsur2 = SW/2;
  11. _global.SHsur2 = SH/2;
  12. Stage.scaleMode = "exactFit";
  13. //----------------------------------------------
  14. rectangle_arrondi_ombre = function (clip, larg, haut, rayon, epais, couleur, transp) {
  15. var mc = clip.createEmptyMovieClip("rectangle_arrondi", 10000);
  16. mc.onLoad = function() {
  17.  with (this) {
  18.   moveTo(rayon, 0);
  19.   //-------------------
  20.   lineStyle(epais, 0x999999, 100);
  21.   beginFill(couleur, transp);
  22.   moveTo(rayon, 0);
  23.   lineTo(larg-rayon, 0);
  24.   curveTo(larg, 0, larg, rayon);
  25.   lineTo(larg, haut-rayon);
  26.   curveTo(larg, haut, larg-rayon, haut);
  27.   lineTo(rayon, haut);
  28.   curveTo(0, haut, 0, haut-rayon);
  29.   lineTo(0, rayon);
  30.   curveTo(0, 0, rayon, 0);
  31.   endFill();
  32.  }
  33.  var filter:DropShadowFilter = new DropShadowFilter(5, 45, 0x000000, .6, 6, 6, 1, 2, false, false, false);
  34.  var filterArray:Array = new Array();
  35.  filterArray.push(filter);
  36.  this.filters = filterArray;//
  37. };
  38. mc.onLoad();
  39. };
  40. //----------------------------------------------
  41. _root.createEmptyMovieClip("cadre", -1111);
  42. cadre.onLoad = function() {
  43. this._x = 2;
  44. this._y = 2;
  45. rectangle_arrondi_ombre(this, SW-10, SH-10, SW/30,1, 0xC0DFFD,100);
  46. };
  47. cadre.onLoad();
  48. //----------------------------------------------
  49. chargement_jpg = function (clip, jpg, couleur) {
  50. clip._alpha = 0;
  51. var mcLoader:MovieClipLoader = new MovieClipLoader();
  52. mcLoader.addListener(loadListener);
  53. mcLoader.loadClip(jpg, clip.dest);
  54. loadListener.onLoadInit = function(mc_cible:MovieClip):Void  {
  55.  var CI_PAR = mc_cible._parent;
  56.  //----------------------------------------------
  57.  mc_cible.proportion = (mc_cible._width/mc_cible._height);
  58.  mc_cible._width = Math.floor(CI_PAR._w0*2);
  59.  mc_cible._height = Math.floor(CI_PAR._h0*2);
  60.  // --------------------
  61.  if (Number(mc_cible.proportion)<1) {
  62.   CI_PAR._h0 = CI_PAR._w0/mc_cible.proportion;
  63.  } else {
  64.   CI_PAR._w0 = CI_PAR._h0*mc_cible.proportion;
  65.  }
  66.  CI_PAR._width = CI_PAR._w0;
  67.  CI_PAR._height = CI_PAR._h0;
  68.  /*
  69.  */
  70.  //----------------------------------------------
  71.  new Tween(CI_PAR, "_alpha", Strong.easeIn, 0, 100, 2, true);
  72.  TransitionManager.start(CI_PAR, {type:Fly, direction:Transition.IN, duration:3, easing:Strong.easeOut, startPoint:random(10)});
  73.  TransitionManager.start(CI_PAR, {type:Rotate, direction:Transition.IN, duration:3, easing:Strong.easeOut, ccw:false, degrees:random(720)});
  74.  TransitionManager.start(CI_PAR, {type:Zoom, direction:Transition.IN, duration:3, easing:Strong.easeOut});
  75.  //----------------------------------------------
  76.  CI_PAR.onPress = cliquer;
  77.  CI_PAR.onRelease = relacher;
  78.  CI_PAR.onReleaseOutside = relacher;
  79.  CI_PAR.swapDepths(this.getNextHighestDepth());
  80. };
  81. };
  82. // -----------------------------------------------------
  83. cliquer = function () {
  84. var grossissement_V = SH*.94;
  85. var grossissement_H = grossissement_V*this.dest.proportion;
  86. if (grossissement_H>SW*.8) {
  87.  delta = grossissement_H/SW*.8;
  88.  grossissement_V *= delta;
  89.  grossissement_H *= delta;
  90. }
  91. //---------------------                                                                             
  92. delete this.onEnterFrame;
  93. //---------------------
  94. this._x0 = _root._xmouse-this._x;
  95. this._y0 = _root._ymouse-this._y;
  96. this.swapDepths(_root.niveau += 20);
  97. this.onEnterFrame = function() {
  98.  this._x = _root._xmouse-this._x0;
  99.  this._y = _root._ymouse-this._y0;
  100.  this._ww = this._width/2;
  101.  this._hh = this._height/2;
  102.  if ((this._x-this._ww)<0) {
  103.   this._x = this._ww;
  104.  }
  105.  if ((this._y-this._hh)<0) {
  106.   this._y = this._hh;
  107.  }
  108.  if ((this._x+this._ww)>SW-10) {
  109.   this._x = SW-this._ww-10;
  110.  }
  111.  if ((this._y+this._hh)>SH-10) {
  112.   this._y = SH-this._hh-10;
  113.  }
  114.  this._rotation += (0-this._rotation)/1.5;
  115.  this._width += (grossissement_H-this._width)/1.2;
  116.  this._height += (grossissement_V-this._height)/1.2;
  117. };
  118. };
  119. relacher = function () {
  120. delete this.onEnterFrame;
  121. this._x = (_root._xmouse<50) ? 50 : (_root._xmouse>SW-50) ? SW-50 : _root._xmouse;
  122. this._y = (_root._ymouse<50) ? 50 : (_root._ymouse>SH-50) ? SH-50 : _root._ymouse;
  123. this.onEnterFrame = function() {
  124.  this._rotation += (this._r-this._rotation)/2;
  125.  this._width += (this._w0-this._width)/2;
  126.  this._height += (this._h0-this._height)/2;
  127.  if (Math.abs(this._w0-this._width)<10) {
  128.   this._rotation = this._r;
  129.   this._width = this._w0;
  130.   this._height = this._h0;
  131.   delete this.onEnterFrame;
  132.  }
  133. };
  134. };
  135. // -----------------------------------------------------
  136. allons_y = function (clip, tableau) {
  137. var L = SW/(tableau.length+2)*2.5;
  138. var L = SW/7;
  139. L = Math.floor(L*.9);
  140. var M = L+5;
  141. for (var i = 0; i<tableau.length; i++) {
  142.  clip = _root.createEmptyMovieClip("cadre"+i, i);
  143.  clip.onLoad = function() {
  144.   //--------------------
  145.   this._alpha = 30;
  146.   this.lineStyle(4, 0, 20);
  147.   this.moveTo(-(L+2), L);
  148.   //this.lineTo(M, L);
  149.   //this.lineTo(M, -(L - 3));
  150.   // --------------------
  151.   this.moveTo(M, -L);
  152.   this.lineStyle(0, 0xFFFFFF);
  153.   this.beginFill(0xffffff, 100);
  154.   this.lineTo(-M, -L);
  155.   this.lineTo(-M, L);
  156.   this.lineStyle(0, 0x333333);
  157.   this.lineTo(M, L);
  158.   this.lineTo(M, -L);
  159.   this.endFill();
  160.   //--------------------
  161.   this._x0 = (1.2*(i+1))*L;
  162.   this._y0 = L;
  163.   this._x = this._x0;
  164.   this._y = this._y0;
  165.   //--------------------
  166.   this._w0 = L+3;
  167.   this._h0 = L-5+3;
  168.   this._width = this._w0;
  169.   this._height = this._h0;
  170.   //--------------------
  171.   this._x = (SW*.15)+random(SW*.7);
  172.   this._y = (SH*.15)+random(SH*.7);
  173.   this._r = -30+60*Math.random();
  174.   this._rotation = this._r;
  175.   var filter:DropShadowFilter = new DropShadowFilter(8, 45, 0x000000, .5, 6, 6, 1, 3, false, false, false);
  176.   var filterArray:Array = new Array();
  177.   filterArray.push(filter);
  178.   this.filters = filterArray;
  179.   //--------------------
  180.   this.createEmptyMovieClip("dest", i+200);
  181.   //--------------------
  182.   this.dest.onLoad = function() {
  183.    this._x = -L-3;
  184.    this._y = -L+2;
  185.    //var ladress = tableau[i] + "?" + random(99999);
  186.    var ladress = tableau[i];
  187.    chargement_jpg(this._parent, ladress, 0xff8800);
  188.   };
  189.   this.dest.onLoad();
  190.  };
  191.  clip.onLoad();
  192. }
  193. };
  194. //------------------------------------------------------
  195. niveau = 10000;
  196. //------------------------------------------------------
  197. _global.fichier = [];
  198. System.security.allowDomain("http://s500.free.fr" );
  199. _global.repertoire = "http://s500.free.fr/pires/villa/";
  200. //------------------------------------------------------
  201. for (x=1; x<60; x++) {
  202. fichier.push("photo_"+x+".jpg" );
  203. }
  204. /**/
  205. for (var i = 0; i<fichier.length; i++) {
  206. fichier[i] = repertoire+fichier[i];
  207. //trace(fichier[i]);
  208. }
  209. _root.createEmptyMovieClip("phototheque", 0);
  210. phototheque.onLoad = function() {
  211. allons_y(this, fichier);
  212. };
  213. phototheque.onLoad();
  214. //------------------------------------------------------
  215. stop();
  216. //------------------------------------------------------


---------------
Newsletter RCZ : inscriptions compliquées ou réceptions tardives ? Mon blog la partage sans délai. C est ici que ça se passe : https://gravelparis.com/
mood
Publicité
Posté le 31-01-2006 à 17:33:18  profilanswer
 

n°1295729
mechkurt
Posté le 31-01-2006 à 17:38:34  profilanswer
 

[:airforceone]  
t'as plus qu'a virer et/ou modifier toutes references à _root, à Stage et prier pour que ca marche...


---------------
D3
n°1295866
sakuraba
Posté le 31-01-2006 à 20:20:40  profilanswer
 

lol je sais pas le faire il faut que je me forme je crois car je patine


---------------
Newsletter RCZ : inscriptions compliquées ou réceptions tardives ? Mon blog la partage sans délai. C est ici que ça se passe : https://gravelparis.com/

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Flash/ActionScript

  [as] mettre un swf à la place d'un texte dynamique ou dedans

 

Sujets relatifs
[PHP] vBulletin mettre un bloc "login" en dehors du forumNewsletter reception html et texte
Problème avec le texteMettre une icone pour un fichier donné
Un texte avec différentes policesinstanciation dynamique de matrice
Probleme avec taille du texte dans une tablezone texte HTML
[VBA] convertir texte en num dans une boucle 
Plus de sujets relatifs à : [as] mettre un swf à la place d'un texte dynamique ou dedans


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR