Articles in the Javascript Category
ActionScript 3.0, Flash CS4, Flex, Javascript »
Changing the size of flash document from Javascript will be handy in many situations like creating Flash widgets like
News scroller
Flash Banners
..
In this article we are going to create that effect.
First we need to import necessary classes.
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.display.MovieClip;
The next step is to align the stage to TOP LEFT and scalemode to no scale.
Means we are aligning the stage to topleft even if we resize it and not scaling the contents on resize
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
The final step is to add Event listener for stage resize
stage.addEventListener(Event.RESIZE, handleResize);
function handleResize(e:Event):void
{
//The …
ActionScript 3.0, Flash CS4, Javascript »
Finally the default menu items from the Flash player can be removed.
Since when I started working in Flash, was thinking is there any option, but finally it came into action.
Now the developer can use this Code to hide the default right click menu in Flash through actionscript and javascript together.
The flash file(SWF) should be embedded inside a HTML page with the javascript file called.
But one sad new is that this will not work with opera browser.
Game developer and RIA – Rich internet Application can leverage this functionalit to hide/remove the …
Javascript »
Few days back while working with “InnerHtml”, I realized that the tag doesn’t work properly for Firefox and Safari.So I tried searching for the solution, by checking the tag against each browser using JavaScript.
I replaced “InnerHtml” with “textContent” (Firefox and Safari) and “innerText†(IE5+) and it worked!
if (document.layers) {
type=”NN”;
} else {
if (document.all) {
if (document.getElementById) {
//type=”IE5+”;
var spanTags = document.getElementsByTagName(’span’);
for (var i = 0; i
