5 Replies Latest reply on May 4, 2015 9:34 AM by kglad

    When i export the project as swf

    sotirisv77862423

      I have this code in scene4 and when i play it from the project with ctrl+enter the kuler in this scene play and load the color theme correctly. When i export the project as swf the scene4 with this code play but they do not load the color theme. why?

       

      stop();

       

       

      button_12.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene1);

       

       

      function fx_ClickToGoToScene1(event:MouseEvent):void

      {

        MovieClip(this.root).gotoAndPlay(1, "Scene1");

      }

       

       

      button_13.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene2);

       

       

      function barca_ClickToGoToScene2(event:MouseEvent):void

      {

        MovieClip(this.root).gotoAndPlay(1, "Scene2");

      }

       

       

       

       

      button_14.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene3);

       

       

      function dfdfs_ClickToGoToScene3(event:MouseEvent):void

      {

        MovieClip(this.root).gotoAndPlay(1, "Scene3");

      }

       

       

       

       

       

       

      import com.pixelfumes.kuler.*;

      import flash.events.Event;

       

       

      import fl.managers.StyleManager;

      StyleManager.setStyle("scrollBarWidth",11);

       

       

      var kuler:JSFLKuler = new JSFLKuler();

       

       

      var devKey:String = "29CE344635AB36DB7F2A50B3C8AC7E55";

      kuler.loadFeed("http://kuler-api.adobe.com/rss/get.cfm?listtype=recent&key="+devKey);

       

       

      preloader_mc.gotoAndPlay(2);

       

       

      kuler.addEventListener(com.pixelfumes.kuler.JSFLKuler.FEED_LOADED, onFeedReady);

      kuler.addEventListener(com.pixelfumes.kuler.JSFLKuler.FEED_FAILED, onFeedFailed);

       

       

      var stubMC:MovieClip = new MovieClip();

      sp.source = stubMC;

       

       

      function onFeedReady(e:Event):void{

        if(kuler.getItemCount() < 1){

        feedControl_mc.status_txt.text = "No Results";

        }else{

        for(var i:uint=0;i<kuler.getItemCount();i++){

        var ki = new KulerItem();

        stubMC.addChild(ki);

        ki.y = i*60;

        ki.setLabel(kuler.getItem(i).title);

        ki.setSwatchColors(kuler.getItem(i).hexColor)

        ki.setRating(kuler.getItem(i).rating);

        }

       

        sp.refreshPane();

        }

        hidePreloader()

      }

       

       

      function onFeedFailed(e:Event):void{

        feedControl_mc.status_txt.text = "Feed Load Failed";

        hidePreloader();

      }

       

       

       

       

      function removeKulerItems():void{

        stubMC = null;

        stubMC = new MovieClip();

        sp.source = stubMC;

      }

       

       

      function hidePreloader():void{

        preloader_mc.visible = false;

      }

       

       

      function showPreloader():void{

        preloader_mc.visible = true;

      }

       

       

      var kulerTF:TextFormat = new TextFormat();

      kulerTF.color = 0xFFFFFF;

       

       

      kulerTF.font = "Arial";

      StyleManager.setComponentStyle(TextInput, "textFormat", kulerTF);

       

       

      search_btn.addEventListener("mouseDown",onSearch);

      function onSearch(e:Event):void{

        if(search_txt.text != ""){

        feedControl_mc.gotoAndStop(4);

        removeKulerItems();

        showPreloader();

        kuler.loadFeed("http://kuler-api.adobe.com/rss/search.cfm?searchQuery="+search_txt.text+"&startIndex=0&itemsPerPage=100&key="+devKey);

        }

      }

       

       

      search_txt.addEventListener("keyDown",onKeyDownEvent);

       

       

      function onKeyDownEvent(e:KeyboardEvent):void{

        if(e.keyCode == 13){

        onSearch(e);

        }

      }

       

       

      //JSFL

      function executeJSFL(args){

        var file = args.shift();

        var func = args.shift();

        var result;

        if( args.length > 0 ){

        var arg = args.join( "\',\'" );

        result = MMExecute(((((("fl.runScript(fl.configURI+\'Commands/" + file) + "\',\'") + func) + "\',\'") + arg) + "\');");

        }

        else{

        result = MMExecute(((("fl.runScript(fl.configURI+\'Commands/"+ file) + "\',\'") + func) + "\');");

        }

        return( result );

      }

       

       

      function flTrace(str){

        MMExecute("fl.trace(unescape(\""+ escape(str)+"\"));");

      }

       

       

      this.addEventListener(com.pixelfumes.kuler.KulerItem.ITEM_SELECTED, onItemSelected);

       

       

      function onItemSelected(e:Event):void{

        var args:Array = e.target.swatchColors;

        args.push(escape(e.target.schemeName));

        trace(e.target.swatchColors);

        executeJSFL(["kuler/kuler.jsfl","addSwatches",args]);

      }

       

       

      info_btn.addEventListener("mouseDown",onInfoClick);

      function onInfoClick(e:Event):void{

        executeJSFL(["kuler/kuler.jsfl","showInfo"]);

      }