A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: publication problem with flash 8 ?

  1. #1
    Junior Member
    Join Date
    Jul 2015
    Posts
    5

    publication problem with flash 8 ?

    Hi all,

    I put an animation in a site created with flashCS4 with this script to keep waiting the load :

    Code:
    var Barre:MovieClip;
    var Pourcentage:TextField;
    var Attente:TextField;
    
    PourPourcentage.html = true;
    PourAttente.html = true;
    function onEnterFrame(){
        var pc = _root.getBytesLoaded()*100/_root.getBytesTotal();
        Barre._xscale = pc;
        Attente.htmlText = "Merci de patienter";
    	Pourcentage.htmlText = "<b>"+Math.round(pc)+"%</b> effectués";
        if (pc >= 100){
            delete onEnterFrame;
            Play();
        }
    }
    stop();
    I updated the file with CS6 and after publication I have a bug ( no more percentage and vanished text) .
    I publish it by selecting flashplayer8 and actionscript2… But that does not solve the problem.

    Anybody could do something for me ?

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    You either need to create the textfields dynamically or you or removed them from the stage.
    Attach all your files that yo use.

  3. #3
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    PHP Code:
    stop();

    var 
    Barre:MovieClip;

    var 
    Pourcentage:TextField this.createTextField("Pourcentage"11001010);
    var 
    Attente:TextField this.createTextField("Attente"210201010);

    Pourcentage.html true;
    Attente.html true;

    Pourcentage.autoSize true;
    Attente.autoSize true;

    //textformat = new TextFormat();
    //textformat.color = 0xff0000;

    //Pourcentage.setTextFormat(textformat);
    //Attente.setTextFormat(textformat);

    function onEnterFrame()
    {
        var 
    pc:Number Math.round(_root.getBytesLoaded() * 100 _root.getBytesTotal());
        
    trace(pc);

        
    Barre._xscale pc;
        
    Attente.htmlText "Merci de patienter";
        
    Pourcentage.htmlText "<b>" pc "%</b> effectués";

        if (
    pc >= 100)
        {
            
    delete onEnterFrame;
            
    Play();
            
    trace("Playing");
        }


  4. #4
    Junior Member
    Join Date
    Jul 2015
    Posts
    5
    Hi, thank you very much for your help !
    I have tried your code. Actually, the percentage is visible but not in the right place ?? There 's an another problem : the percentage and the message "merci de patienter" does not vanished when the animation is loaded ??
    Here is my code in my html file :

    PHP Code:
            <script type="text/javascript" src="css/js/swfobject.js"></script>
            <
    script type="text/javascript">
            var 
    flashvars = {};
            var 
    params = {};
            
    params.wmode="transparent";
            
    swfobject.embedSWF("css/swf/fond_AFF.swf","anim","900","800","10.0.0","css/js/expressinstall.swf",flashvars,params);
            
    swfobject.embedSWF("css/swf/fond_AFF.swf","boutaffret","0","0","10.0.0","css/js/expressinstall.swf",flashvars,params);
            </
    script
    Sorry, I am not a develpper, I just need this code which was ok and doesnot work anymore...

  5. #5
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    It would help to see the files.

    To remove a dynamic textField = textName.removeTextField(); so do that for both when complete

  6. #6
    Junior Member
    Join Date
    Jul 2015
    Posts
    5

  7. #7
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    You needed to embed the fonts, but if you do use my code, then add the red parts

    if (pc >= 100)
    {
    delete onEnterFrame;
    play();
    trace("Playing");
    Pourcentage.removeTextField();
    Attente.removeTextField();

    }

  8. #8
    Junior Member
    Join Date
    Jul 2015
    Posts
    5
    Hi,

    sorry for the long time before my answer, thank you very much for that, the loading is very much faster !!! Actuallly I had to try it on a very slow system to improve it (which explain the time before my answer) and the percentage and the message doesn't work ?

  9. #9
    Junior Member
    Join Date
    Jul 2015
    Posts
    5
    Hi, I shall let this. Thanks a lot for your precious help, Fruitbeard !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center