When we embed the swf in a html page and view it in browser.
Its not active by default and on rollOver we get a message like this
: Press SPACEBAR or ENTER to Activate and use this control.
To Avoid this problem follow the following steps
1) Replace the object tag in html (in which we are embeding swf) by div
<div class="div03" style="opacity: .75; height: 385px;" id="flashContentLayer">
<script language='javascript'>fnPutFlashObject()</script>
2) write a function fnPutFlashObject() in an external js file
function fnPutFlashObject()
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="1000" height="392" id = "main">');
document.write('<param name="movie" value="swf/flash-banner_left_ver1.swf">');
document.write('<PARAM NAME=wmode VALUE=transparent>');
document.write('<PARAM NAME=menu VALUE=false>');
document.write('<param name="quality" value="high">');
document.write('<embed src="swf/flash-banner_left_ver1.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="1000" height="392" id="main"></embed>');
document.write('</object>');
}
3) and include this js file in script tag
<script type="text/JavaScript" src="jsFiles/Source.js">
and it works !
Tuesday, February 20, 2007
Tuesday, February 13, 2007
sprites in mxml
While adding a sprite to mxml base application it produces a error like :
cannot convert flash.display::Sprite@3d2a191 to mx.core.IUIComponent.
Sprite is nothing but a new object introduce which is similar to movieClip. We can draw inside it and place it on to the stage by using its graphic object
The reason for error is mailny because sprite is the superclass of UIComponent , where as to add any object in mxml base container we need it to be a type of UIComponent. As the UIComponent class is the base class for all visual components. addChild method in UIcompoent Overrides the addChild method DisplayObjectContainer’saddChild method and adds a new object to mxml base container. (DisplayObjectContainer’ is a super class of sprite class ) Hence when we do addChild(newObject) we get a error , if newObject is of type sprite, as addChild which is invoked is of UIComponent class's method.
Hence we need to add a sprite to UIcompoent first and then the UIcomponent to mxml base container as follows :
<?xml:namespace prefix = mx /><mx:application initialize="drawStuff()" layout="absolute" mx="http://www.adobe.com/2006/mxml">
</mx:script>
cannot convert flash.display::Sprite@3d2a191 to mx.core.IUIComponent.
Sprite is nothing but a new object introduce which is similar to movieClip. We can draw inside it and place it on to the stage by using its graphic object
The reason for error is mailny because sprite is the superclass of UIComponent , where as to add any object in mxml base container we need it to be a type of UIComponent. As the UIComponent class is the base class for all visual components. addChild method in UIcompoent Overrides the addChild method DisplayObjectContainer’saddChild method and adds a new object to mxml base container. (DisplayObjectContainer’ is a super class of sprite class ) Hence when we do addChild(newObject) we get a error , if newObject is of type sprite, as addChild which is invoked is of UIComponent class's method.
Hence we need to add a sprite to UIcompoent first and then the UIcomponent to mxml base container as follows :
<?xml:namespace prefix = mx /><mx:application initialize="drawStuff()" layout="absolute" mx="http://www.adobe.com/2006/mxml">
import mx.core.UIComponent;
var bgColor:uint = 0xFFCC00;
public function drawStuff() : void
{
var ref : UIComponent = new UIComponent(); // creating a UI compoent Object
var circle1 : Sprite = new Sprite();
circle1.graphics.beginFill(bgColor);
circle1.graphics.drawCircle( 40, 40, 40 );
circle1.buttonMode = true;
addChild( ref ); // add UI component to mxml base container
ref.addChild( circle1 );// adding sprite to UIcompoent
}
]]>
</mx:Script>
</mx:Application>
Thursday, January 25, 2007
Attitude ...just thiking
Whenever life acts we respond.
In determining how we face life it is our attitude.Fortunately, we control our attitudes.
"WE are responsible for all of our experiences of LIFE."
we are not responsible for everything that happens to us,
but we are responsible for how we react to what does happen to us
. The formula is that, "Life acts. we react." our reaction is under our control.
In any life situation we are always responsible for at least one thing.
we are always responsible for the attitude towards the situation in which we find ourself.
our attitude is our reaction to what life gives us. we can have either a more positive or a more negative attitude.
our attitude is under our control and can be changed.
With the right attitude we can be a HAPPY person
"WE are responsible for all of our experiences of LIFE."
we are not responsible for everything that happens to us,
but we are responsible for how we react to what does happen to us
. The formula is that, "Life acts. we react." our reaction is under our control.
In any life situation we are always responsible for at least one thing.
we are always responsible for the attitude towards the situation in which we find ourself.
our attitude is our reaction to what life gives us. we can have either a more positive or a more negative attitude.
our attitude is under our control and can be changed.
With the right attitude we can be a HAPPY person
Tuesday, January 9, 2007
InfoWorld : 2007 Technology of the Year Awards: App Dev
8 technologies are awarded as technologies of the year by info world.
Adobe Flex is also mentioned there as the leading RIA technology.
http://www.infoworld.com/slideshow/2007/01/25-2007_technology-8.html
http://www.infoworld.com/slideshow/2007/01/25-2007_technology-8.html
Friday, December 29, 2006
Subscribe to:
Posts (Atom)
