Hello, Here you are find some easy way to add swf object in your server page. version 1.0.0 is a refres object value whenever this value is changed swfobject.js is load fresh swf object in your web browser otherwise your browser is loaded old cashing swf object. you are adding more tha one variable using flashvars object and get this value into your action script code. Javascript and link part : ====================== <link href="history/history.css" rel="stylesheet" type="text/css" /> <script src="history/history.js" type="text/javascript"></script> <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript"> // <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> // <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. --> // <!-- set params.wmode = "opaque"; in var params = {} for set direct focus on swf in crome but its create internal scrolling issue with mouase wheel --> var swfVersionStr = "10.0.0"; var xiSwfUrlStr = "playerProductInstall.swf"; var flashvars = {}; flashvars.variable1 = "Var1 Val"; flashvars.variable2 = "Var2 Val"; var params = {}; params.quality = "high"; params.bgcolor = "#ffffff"; params.allowscriptaccess = "sameDomain"; params.allowfullscreen = "true"; params.allownetworking = "all"; var attributes = {}; attributes.id = "project1"; attributes.name = "project1"; attributes.align = "middle"; swfobject.embedSWF( "project1.swf?ver=1.0.0", "flashContent", "100%", "100%", swfVersionStr, xiSwfUrlStr, flashvars, params, attributes); <!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. --> swfobject.createCSS("#flashContent", "display:block;text-align:left;"); <!--function getURLOfBrowser(){return window.location.href;}--> </script> ====================== Body part : ====================== <div id="flashContent"> <p> To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed. </p> <!--<script type="text/javascript"> var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://"); document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" + pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); </script> --> </div> <noscript> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" id="Main"> <param name="movie" value="project1.swf?ver=1.0.0" /> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" /> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="true" /> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data="project1.swf?ver=1.0.0" width="100%" height="100%"> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" /> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="true" /> <!--<![endif]--> <!--[if gte IE 6]>--> <p> Either scripts and active content are not permitted to run or Adobe Flash Player version 10.0.0 or greater is not installed. </p> <!--<![endif]--> <!--<a href="http://www.adobe.com/go/getflashplayer"> <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" /> </a>--> <!--[if !IE]>--> </object> <!--<![endif]--> </object> </noscript>
Wednesday, July 3, 2013
Set swf object in your server page
Monday, July 1, 2013
In Adobe Flex Masking of two images
Hello friends,
I am looking for masking functionality like solid view and when we move move on solid image we are able to show skeleton images of selected portion.
We are googling for masking and find some help.
Below is some action script code of masking gradient ellipse portion in second image.
Here i am taking one group in that i add both images skeleton images on front and solid images on back.
I am applying mask on skeleton image.
Action Script Code :
/ /==============================
I am looking for masking functionality like solid view and when we move move on solid image we are able to show skeleton images of selected portion.
We are googling for masking and find some help.
Below is some action script code of masking gradient ellipse portion in second image.
Here i am taking one group in that i add both images skeleton images on front and solid images on back.
I am applying mask on skeleton image.
Action Script Code :
/ /==============================
// Load an image and add it to the display list.
/* var loader:Loader = new Loader();
var url:URLRequest = new URLRequest("http://www.helpexamples.com/flash/images/image1.jpg");
loader.load(url);
this.addChild(loader); */
// Create a Sprite.
var oval:SpriteVisualElement = new SpriteVisualElement();
// Draw a gradient oval.
var colors:Array = [0x000000, 0x000000];
var alphas:Array = [1, 0.8];
var ratios:Array = [0, 255];
var matrix:Matrix = new Matrix();
matrix.createGradientBox(200, 100, 0, -100, -50);
oval.graphics.beginGradientFill(GradientType.RADIAL,
colors,
alphas,
ratios,
matrix);
oval.graphics.drawEllipse(-100, -50, 200, 100);
oval.graphics.endFill();
/* oval.graphics.beginFill(0x000000,1);
oval.graphics.drawCircle(-100, -100, 100);
oval.graphics.endFill(); */
grp.addElement(oval);
// Set cacheAsBitmap = true for both display objects.
img2.cacheAsBitmap = true;
oval.cacheAsBitmap = true;
// Set the oval as the mask for the loader (and its child, the loaded image)
img2.mask = oval;
// Make the oval draggable.
oval.startDrag(true);
/ /==============================
I am applying above code on creationcomplete event.
So now when i mouse over then only see skeleton image's eclipse portion on top of solid image.
So now when i mouse over then only see skeleton image's eclipse portion on top of solid image.
Subscribe to:
Comments (Atom)