tobitailor / gordon Goto Github PK
View Code? Open in Web Editor NEWAn open source Flash™ runtime written in pure JavaScript
License: MIT License
An open source Flash™ runtime written in pure JavaScript
License: MIT License
I am unable to make this .swf file work with your solution. It was created with Adobe Flex Builder.
The .swf file download is here http://explozer.itspx.com/iphoneflex2/QuickSample.swf.zip
It should look like this http://explozer.itspx.com/iphoneflex2/QuickSample.swf .
Thank you very very much for any help you can provide.
I'm trying to use your zlib function to deflate image data and it's not coming out 100% correct. What I end up is about 90% of a the correct image, then 10% where it looks corrupted because there wasn't enough data.
For example, I'm deflating the alphaData on a JPG with alpha. The alphaData.length is 141,143 where as the number of pixels in the image is (imgData.data.length) is 141,198, so i'm missing 55 pixels worth of alpha data.
Any idea why this could be happening?
This is a really cool project. You will rule the world if you create a bookmarklet that lets you use gordon to render swf files on-the-fly. This would help, for example, to render swf files on the iPhone that can't otherwise be seen at all.
Great Work!
Mike
It would be nice to be able to use gordon from https://unpkg.com that serve files from npm. So you can create Demo on codepen.io without the server.
gordon name is taken but you can publish to gordon.js or swf-gordon or something else.
I visited all your demo files on my iphone and they work flawlessly
I downloaded the javascript file (gordon.js) and droped it on a folder in the root of my site, then after that didn't work i dropped it in the root of my site.
I noticed the downloads section (gordon.js) is a bit different than the (gordon.js) file that is on your server. here; http://paulirish.com/work/gordon
does it matter which one i use?
I used one, then the other and both didn't work for me.
I also dropped the folder (src) with all the javascripts within it in the same root.
The code i used was:
<script type="text/javascript" src="temp/gordon.js"></script>Hi,
I was wondering if it would be possible to use Gordon to display an SWF on a different site than the web page it's on. From my understanding, JavaScript on one site can't access files on a different site(?). So does that mean it's impossible?
Thanks,
Hello there,
would you please so kind and create a Wiki Page, where everybody can read out the tools need to be used for compiling gordon.js? (I tryed Ruby with http://rake.rubyforge.org... but failed)
Danke ( ;) ) & Regards,
HolmesSherlock
I'm using parts of gordon for parsing a swf and noticed that it doesn't handle images very well. Below is some adjusted code that handled everything (so far) except lossless pix15 and jpeg4 because i can't seem to create test scenarios. I figured since gordon has helped so much on my project it was only fit to return the favor.
if(colorData) {
var colorTableSize = obj.colorTableSize || 0,
withAlpha = obj.withAlpha,
bpp = (withAlpha || (obj.format == 5) ? 4 : 3),
cmIdx = colorTableSize * bpp,
pxIdx = 0,
canvas = this.doc.createElement("canvas"),
ctx = canvas.getContext("2d"),
imgData = ctx.createImageData(width, height),
pad = colorTableSize ? ((width + 3) & ~3) - width : 0;
canvas.width = width;
canvas.height = height;
// If colorTableSize, then image is Colormapped
// If no colorTableSize, then image is Direct
// Without Alpha
// (BitmapFormat 3) Colormapped Images are stored RGB, canvas uses RGBA
// (BitmapFormat 4) Direct Images 15bit are UB[1] res, UB[5] red, UB[5] green, UB[5] blue
// (BitmapFormat 5) Direct Images 24bit are UI8 res, UI8 red, UI8 green, UI8 blue
// With Alpha
// (BitmapFormat 3) Colormapped Images are stored RGBA, canvas uses RGBA
// (BitmapFormat 5) Direct Images 32bit are stored ARGB, canvas uses RGBA
if(obj.format == 4) colorData = new Flashbug.BytearrayString(colorData.join(''));
for (var y = 0; y < height; y++) {
for (var x = 0; x < width; x++) {
var idx = (colorTableSize ? colorData[cmIdx++] : cmIdx++) * bpp, r, g, b, a;
if(withAlpha) {
r = colorTableSize ? colorData[idx] : colorData[idx + 1];
g = colorTableSize ? colorData[idx + 1] : colorData[idx + 2];
b = colorTableSize ? colorData[idx + 2] : colorData[idx + 3];
a = colorTableSize ? colorData[idx + 3] : colorData[idx];
} else {
if(obj.format == 3) {
r = colorData[idx];
g = colorData[idx + 1];
b = colorData[idx + 2];
} else if(obj.format == 4) {
// Untested
colorData.readUB(1); // Reserved
r = colorData.readUB(5);
g = colorData.readUB(5);
b = colorData.readUB(5);
} else if(obj.format == 5) {
//colorData[idx]; // Reserved
r = colorData[idx + 1];
g = colorData[idx + 2];
b = colorData[idx + 3];
}
a = 255;
}
// BUG: Corrupted color data? (zlib?)
// had an image that wasn't the correct data size
// colorData.length = 65529
// imgData.data.length = 65536
// delta 7px
if(a) {
imgData.data[pxIdx] = r || 0; //R
imgData.data[pxIdx + 1] = g || 0; //G
imgData.data[pxIdx + 2] = b || 0; //B
imgData.data[pxIdx + 3] = a; //A
}
pxIdx += 4;
}
cmIdx += pad;
}
ctx.putImageData(imgData, 0, 0);
uri = canvas.toDataURL();
param.value.data = atob(uri.split(',')[1]);
} else {
uri = "data:image/jpeg;base64," + btoa(obj.data);
// Moved to the image onload becuase of drawImage blowing up in Firefox
/*if (obj.alphaData) {
var img = new Image(),
canvas = this.doc.createElement("canvas"),
ctx = canvas.getContext("2d"),
len = width * height,
data = obj.alphaData;
img.src = uri;
canvas.width = width;
canvas.height = height;
//Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMCanvasRenderingContext2D.drawImage]
ctx.drawImage(img, 0, 0); // <-----
var imgData = ctx.getImageData(0, 0, width, height),
pxIdx = 0;
for (var i = 0; i < len; i++) {
imgData.data[pxIdx + 3] = data[i];
pxIdx += 4;
}
ctx.putImageData(imgData, 0, 0);
uri = canvas.toDataURL();
}*/
}
///////////////// in image onload ///////////////////
var canvas = this.doc.createElement("canvas"),
ctx = canvas.getContext("2d"),
len = w * h;
canvas.width = w;
canvas.height = h;
ctx.drawImage(img, 0, 0);
var imgData = ctx.getImageData(0, 0, w, h),
pxIdx = 0;
var counter = 0;
for (var i = 0; i < len; i++) {
var a = obj.alphaData[i];
// BUG: Corrupted Alpha data? (zlib?)
// had an image that wasn't the correct data size
// alphaData.length = 141143
// imgData.data.length = 141198
// delta 55px
if(a != undefined) imgData.data[pxIdx + 3] = a;
pxIdx += 4;
}
ctx.putImageData(imgData, 0, 0);
obj.hasAlpha = true; // Used a flag so when the image calls onload again, it won't mix in the alpha twice
img.src = canvas.toDataURL();
Hello!
If the swf contains an image, it does not work...
is it normal?
thank you!
Hi,
I have downloaded the source and I just keep getting access denied all over the place when I try to execute the scripts. I am running Windows XP SP3 and have kept the directory structure of the ZIP file intact when extracting it.
Any ideas?
Gordon only works with Flash Player 1 & 2, up to version 6 is implemented Action Script 1.0
There is a possibility that gordon run "ActionScript"?
Error: shape is null
Source File: http://127.0.0.1/Gordon/src/_parser.js
Line: 261
Trying to load this swf: http://www.hogeschoolvanamsterdam.nl/walloffame/
I get a "We couldn't find the page you were looking for." for every demo listed in the wiki
I've copied all the files to my website, exactly as you have them in the demo. Nothing is working... Is there some sort of configuration I need to do? Thanks for your help!
which folders, files and root level must be uploaded to server to running Gordon?
root example:
www.somesite.com/demo/example.html
demo/srcipts/build/
demo/srcipts/src/
demo/srcipts/vendor/
demo/srcipts/gordon.js
demo/example.html
demo/example.swf
TobeyTaylor:
what would be the correct settings?
Kind regards
After the latest set of changes, removing twips2px etc, gradients are no longer rendered at the correct scale.
See http://www.openpalace.org/gordon-bug/ for screenshots.
unreachable code after return statement[Learn More]
jquery-1.3.2.min.js:19:13091
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help http://xhr.spec.whatwg.org/
gordon.js:22:113
TypeError: z[q] is undefined
Gordon is truly impressive but I was wondering, when do you think you'd have the support for the latest Flash features (currently support only goes up to Flash 2)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.