PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Bundle .exe and all linked files - Page 2
A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 30 of 30

Thread: Bundle .exe and all linked files

  1. #21
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Here's the code I used to extract all the files in the Files Tab manually. I put it in an EnterFrame function to avoid the same problem you see with automatic extraction (runs too fast and uses all the CPU). This will slow down the splash screen animation, but it won't stop it. All you have to do is put the code to start your app (load files etc) in the extractComplete function and you're good to go.

    Code:
    ssCore.init();
    ssDefaults.synchronousCommands = true;
    
    var g_i = -1;
    var g_a:Array;
    
    function extractFiles()
    {
    	
    	if (_root.g_i == -1)
    	{
    		var r:Object = ssCore.Layout.getFileList({format:"TEXT"});
    		_root.g_a = r.result.split("\r");
    		_root.g_i = 0;
    	}
    	
    	if (_root.g_i != -1)
    	{
    		if (_root.g_i < _root.g_a.length)
    		{
    			ssDebug.trace("extracting " + _root.g_a[_root.g_i]);
    			ssCore.Layout.extractFile({resource:_root.g_a[_root.g_i], destination:"tempdir://"+_root.g_a[_root.g_i]}, {sync:false, callback:"extractNextFile", scope:_root});
    		} 
    		else
    		{
    			_root.extractComplete();
    		}
    	}
    	
    }
    
    function extractNextFile()
    {
    	_root.g_i++;
    }
    
    function extractComplete()
    {
    	delete _root.onEnterFrame;	
    	ssCore.Splash.close({});
    	ssDebug.trace("all files have been extracted");	
    }
    
    extract_btn.onRelease = function()
    {
    	_root.onEnterFrame = _root.extractFiles;	
    }

  2. #22
    Member
    Join Date
    Jan 2007
    Posts
    74
    Tim -

    New problem has come up...

    Now, whenever I click on my movie scrubber, the entire presentation quits. This only happens once everything is compiled with Northcode... if I play my presentation outside the compiled version, and try to scrub through an animation - it works fine. Any ideas?

  3. #23
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    What version of SWF Studio are you using?

    I'm assuming it's an FLV that you're trying to skip around in, what are you doing in the code that moves the playhead?
    When your swf2exe tool just HAS to work
    there's only one choice... SWF Studio

  4. #24
    Member
    Join Date
    Jan 2007
    Posts
    74
    SWF Studio 3.7 - Build 197

    Actionscript Code:
    /////////////////////////////////////////////////////
    // CONTROLS
    /////////////////////////////////////////////////////

    var playState; // 0 - PAUSED , 1 - PLAYING


    playbutton.onRelease = function() {
        pauseIt();
    }

    pausebutton.onRelease = function() {
        pauseIt();
    }


    rewindButton.onRelease = function() {
        ns.seek(0);
    }

    var kbord= new Object();
    Key.addListener(kbord);
    kbord.onKeyDown = function() {
        if (Key.isDown(Key.SPACE))
        {
            pauseIt();
        }
    }

    function pauseIt() {
        ns.pause();
        switch(playState)
        {
            case 0:
                _root.pausebutton._visible = true ;
                _root.playbutton._visible = false ;
                playState = 1;
                break;
            case 1:
                _root.pausebutton._visible = false ;
                _root.playbutton._visible = true ;
                playState = 0;
                break;
        }
    }

    function stopIt() {
        ns.seek(0);
        ns.pause();
    }

    function restartIt() {
        ns.seek(0);
    }

    /////////////////////////////////////////////////////
    // TRACKING
    /////////////////////////////////////////////////////

    var videoInterval = setInterval(videoStatus,100);
    var amountLoaded:Number;
    var duration:Number;
    var durationStop:Number;

    ns["onMetaData"] = function(obj) {
        duration = obj.duration;
        durationStop = duration - 0.1; //Redirect movie
    };


    function videoStatus() {
           amountLoaded = ns.bytesLoaded / ns.bytesTotal;
           loader.loadbar._width = amountLoaded * 868.0;
           loader.scrub._x = ns.time / duration * 868.0;
           if(ns.time > durationStop ){
                _level1.gotoAndStop("Exterior_Interactive");
                exitAndUnload();
           }
    }

    /////////////////////////////////////////////////////
    // SCRUBBING
    /////////////////////////////////////////////////////

    var scrubInterval;

    loader.loadbar.onPress = function() {
        clearInterval(videoInterval);
        loader.scrub._x = loader._xmouse - (loader.scrub._width / 2);
        scrubInterval = setInterval(scrubit,10);
        loader.scrub.startDrag(false, 0, loader.scrub._y, 868.0, loader.scrub._y);
    }

    loader.scrub.onPress = function() {
           clearInterval(videoInterval);
           scrubInterval = setInterval(scrubit,10);
           this.startDrag(false,0,this._y,868.0,this._y);
    }

    loader.scrub.onRelease = loader.scrub.onReleaseOutside = loader.loadbar.onRelease = loader.loadbar.onReleaseOutside = function() {
           clearInterval(scrubInterval);
           videoInterval = setInterval(videoStatus,100);
           loader.scrub.stopDrag();
    }

    function scrubit() {
           ns.seek(Math.floor((loader.scrub._x/868.0)*duration));
    }

  5. #25
    Member
    Join Date
    Jan 2007
    Posts
    74
    Hey Tim -

    We just purchased SWF Studio, I downloaded and registered the latest build, and everything is working correctly now. Lookin' very nice!

    Thanks,
    Marty

  6. #26
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Let me know if this happens again, we're testing a beta version that should be even more stable than 3.7 build 197. The beta also works properly on Windows 7 if that's a concern and since you're a registered user we can get you access to it. Welcome to the family
    When your swf2exe tool just HAS to work
    there's only one choice... SWF Studio

  7. #27
    Member
    Join Date
    Jan 2007
    Posts
    74
    Will the compiled application from my version work on Windows 7?

    There is always a chance someone might have the newest operating system.

    I don't need SWF Studio to run on W7... sticking to XP here...

  8. #28
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    No, here are the known problems with SWF Studio 3.7 build 197 and Windows 7. Send a quick email to support@northcode.com and I'll get you on the beta.
    When your swf2exe tool just HAS to work
    there's only one choice... SWF Studio

  9. #29
    Member
    Join Date
    Jan 2007
    Posts
    74
    Correction... it WAS fixed - but now the video scrubber crashes the whole presentation again. Argh. Frustrating.

    Maybe if I start a new project and re-build it? Everything seems okay until I hit 'save'...

  10. #30
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Make sure you're not calling any ssCore commands from inside a timer callback function (setTimeout, setInterval, etc.) If you are, the beta has a fix for that.
    When your swf2exe tool just HAS to work
    there's only one choice... SWF Studio

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