You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all, I'm opening this issue because I'd like a new feature is implemented into FlashJS, allowing developer to add actionscript bootstrapping in script tag sections. How I imagine the script element is illustrated below.
<script id="actionscript1" type="text/actionscript" data-width="200px" data-height="200px" data-scaletoscreen="false">
<!-- FlashJS ActionScript code goes here without any worries about xml escaped characters -->
</script>
Please note that I've nothing against the actionscript custom HTML tag, but I feel that these application specific tags find their appropriate usage in web design realm and when you need them to support your web application logic. In most browsers your custom tags will be treated as inline elements like span, this means you have to write CSS to declare rules such as "actionscript { display: none }" at least to prevent unwanted content display when JS is disabled or you page is not processed as expected.
Thus, the ActionScript Tag Executor would be easily adapted for the new pseudo script tag as follow.
var $push = Array.prototype.push;
var tags0 = document.getElementsByTagName('actionscript');
var tags1 = document.getElementsByTagName('script');
var tags = [];
$push.apply(tags, tags0);
$push.apply(tags, tags1);
for (var i = 0; i < tags.length; i++) {
var astag = tags[i];
if (astag.tagName === 'SCRIPT' && 'text/actionscript' !== (astag.type || ''))
continue;
var scriptText = replaceAll(astag.innerHTML, "<", '<');
scriptText = replaceAll(scriptText, ">", '>');
var width = astag.getAttribute('data-width') || astag.getAttribute('width');
var height = astag.getAttribute('data-height') || astag.getAttribute('height');
var scaleToScreen = astag.getAttribute('data-scaleToScreen') || astag.getAttribute('scaleToScreen');
var canvas = w.document.createElement('canvas');
canvas.setAttribute('width', width);
canvas.setAttribute('height', height);
canvas.id = 'flashjs' + UID();
// replace existing node astag with the new span element canvas
//astag.parentNode.appendChild(canvas);
//astag.parentNode.removeChild(astag);
astag.parentNode.replaceChild(canvas, astag);
var stage = new Stage('#' + canvas.id, parseInt(width), parseInt(height));
//...
//...
}
I think what is most enticing about this diverse approach is that you don’t have to vary too much the existing code base in order to begin using it.
Best regards, Giorgio Arata.
The text was updated successfully, but these errors were encountered:
Hi all, I'm opening this issue because I'd like a new feature is implemented into FlashJS, allowing developer to add actionscript bootstrapping in script tag sections. How I imagine the script element is illustrated below.
Please note that I've nothing against the actionscript custom HTML tag, but I feel that these application specific tags find their appropriate usage in web design realm and when you need them to support your web application logic. In most browsers your custom tags will be treated as inline elements like span, this means you have to write CSS to declare rules such as "actionscript { display: none }" at least to prevent unwanted content display when JS is disabled or you page is not processed as expected.
Thus, the ActionScript Tag Executor would be easily adapted for the new pseudo script tag as follow.
I think what is most enticing about this diverse approach is that you don’t have to vary too much the existing code base in order to begin using it.
Best regards, Giorgio Arata.
The text was updated successfully, but these errors were encountered: