Herrow
Iâm trying to use this tut from Flash & Math generating realistic moving clouds the two layer effect:
http://www.flashandmath.com/intermediate/cloudsfast/
Here is the test site:
I want the clouds to be moving transparent above the image. I also want the clouds to stretch the length of the image 1024x300. The problem is that the clouds donât generate when I remove the code for the background in the .fla file. See attached file and code below.
import com.flashandmath.dg.GUI.MovingClouds;
var posX:Number=50;
var posY:Number=20;
var clouds1:MovingClouds = new MovingClouds(1024,300,2,3,false);
clouds1.x = posX;
clouds1.y = posY;
clouds1.alpha = 0.4;
var clouds2:MovingClouds = new MovingClouds(1024,300,1,1,false);
clouds2.x = posX;
clouds2.y = posY;
clouds2.alpha = 1;
////when I try to remove this to have transparent bg the clouds do not render////
var blueBackground:Shape = new Shape();
blueBackground.graphics.beginFill(0x000000);
blueBackground.graphics.drawRect(0,0,1024,300);
blueBackground.graphics.endFill();
blueBackground.x = posX;
blueBackground.y = posY;
blueBackground.alpha = 1;
this.addChild(blueBackground);
this.addChild(clouds2);
this.addChild(clouds1);
Below is the HTML source code.
<!DOCTYPE html PUBLIC â-//W3C//DTD XHTML 1.0 Strict//ENâ âhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtdâ>
<html xmlns=âhttp://www.w3.org/1999/xhtmlâ lang=âenâ xml:lang=âenâ>
<head>
<title>Drac VS Frank</title>
<meta http-equiv=âContent-Typeâ content=âtext/html; charset=utf-8â />
<link rel=âstylesheetâ type=âtext/cssâ href=âDracVSFrank.cssâ>
</head>
<body>
<div id=âflashContentâ>
<object classid=âclsid:d27cdb6e-ae6d-11cf-96b8-444553540000â width=â1024â height=â300â id=âlayeredcloudsâ align=âmiddleâ>
<param name=âmovieâ value=âlayeredclouds.swfâ />
<param name=âqualityâ value=âhighâ />
<param name=âbgcolorâ value="#ffffff" />
<param name=âplayâ value=âtrueâ />
<param name=âloopâ value=âtrueâ />
<param name=âwmodeâ value=âtransparentâ />
<param name=âscaleâ value=âshowallâ />
<param name=âmenuâ value=âtrueâ />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="layeredclouds.swf" width="1024" height="300">
<param name="movie" value="layeredclouds.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="transparent" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<!--<![endif]-->
<a href="[http://www.adobe.com/go/getflash](http://www.kirupa.com/forum/view-source:http://www.adobe.com/go/getflash)">
<img src="[http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif](http://www.kirupa.com/forum/view-source:http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif)" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</body>
</html>
Any advice will be appreciated. Thanks!
:frankenstein: