From 90757b61ed1243da059b19f4463c5a891a93b5d5 Mon Sep 17 00:00:00 2001 From: Matt Karl Date: Mon, 31 Aug 2015 13:45:41 -0400 Subject: [PATCH] HTML5 Post Publish fix --- package.json | 2 +- src/Tools/HTMLCanvasPostPublish.jsfl | 25 ++++++------------------- src/io.springroll.toolkit.mxi | 2 +- 3 files changed, 8 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index fe20f29..37a2196 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "1.1.0", + "version": "1.1.1", "private": true, "devDependencies": { "grunt": "^0.4.5", diff --git a/src/Tools/HTMLCanvasPostPublish.jsfl b/src/Tools/HTMLCanvasPostPublish.jsfl index 447e49c..e2a0cc8 100644 --- a/src/Tools/HTMLCanvasPostPublish.jsfl +++ b/src/Tools/HTMLCanvasPostPublish.jsfl @@ -46,26 +46,13 @@ var content = FLfile.read(file); - try - { - var empty = function(){}; - - var createjs = { - Container: empty, - Bitmap: empty, - MovieClip: empty, - Shape: empty, - Sprite: empty, - Tween: empty, - Rectangle: empty, - Ease: empty - }; - - eval(content); // jshint ignore:line - } - catch(e) + //find the 'var lib, images, createj, ss;' line at the end of the file + var varFinder = /var (\w+), (\w+), (\w+), (\w+);$/m; + //also, the Flash 2014 'var lib, images, createj;' + var oldVarFinder = /var (\w+), (\w+), (\w+);$/m; + + if(!(varFinder.exec(content) || oldVarFinder.exec(content))) { - fl.trace("error: " + e.message); alert("File was published improperly. Please quit Flash and try publishing again."); return; } diff --git a/src/io.springroll.toolkit.mxi b/src/io.springroll.toolkit.mxi index 3dfc7d2..608fe2f 100644 --- a/src/io.springroll.toolkit.mxi +++ b/src/io.springroll.toolkit.mxi @@ -3,7 +3,7 @@ name="SpringRoll Flash Toolkit" id="io.springroll.toolkit" requires-restart="true" - version="1.1.0"> + version="1.1.1">