|
Hi, This one has got me completely baffled. I have created 2 images 1. bg.gif – width: 1px, height: 600px with a vertical
gradient. 2. outline.gif – width: 900px, height 600px a
transparent image with a 1px black stroke inside I have created an Actionscript project with 1 as set up as
the main application file. I have also set the flex/frameworks.swf in the Project
Properties/ Library Source Check out the code below The result is inconsistent sizing and positioning when
compiled. Here my code package { import
flash.utils.*; import
flash.display.*; public
class zuki extends Sprite { [Embed(source="/assets/bg.gif")]
private var BG_image:Class; [Embed(source="/assets/outline.gif")]
private var Outline_image:Class; private
var className:String; public
function zuki() { //
set stage properties stage.scaleMode
= StageScaleMode.NO_SCALE;
stage.align
= StageAlign.TOP;
//
load and position bg var
bg:Bitmap = createImage('BG_image'); addChild(bg); bg.width
= 950; bg.height
= 600; //
load outline var
outline:Bitmap = createImage('Outline_image'); addChild(outline); } private
function createImage(embedLinkage:String):Bitmap { if(className
== null) { className
= describeType(this)[EMAIL PROTECTED](); } var
imgName:String = className + "_" + embedLinkage; var
imgRef:Object = getDefinitionByName(imgName); var
img:Bitmap = new imgRef(); return
img; } } } Also the HTML if of any interest <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1"> <script type="text/_javascript_" src=""> <style> body {
background-image: url(assets/image/bg.gif); } </style> </head> <body leftmargin="0" topmargin="0"
marginheight="0" marginwidth="0"> <center> <div
id="flashcontent"> <strong>You
need to upgrade your Flash Player</strong> </div> <script
type="text/_javascript_"> //
<![CDATA[ var
so = new SWFObject("assets/swf/zuki.swf", "zuki",
"950", "600", "9.0.0", "#FF6600",
true); so.write("flashcontent"); //
]]> </script> </center> </body> Bjorn Schultheiss
Personalised Communication Power 3205, VIC Australia ((------------This transmission is
confidential and intended solely for the person or organization to whom it is
addressed. It may contain privileged and confidential information. If you are
not the intended recipient, you should not copy, distribute or take any action
in reliance on it. If you believe you received this transmission in error,
please notify the sender.---------------)) -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
YAHOO! GROUPS LINKS
|
- [flexcoders] Actionscript Project - Weird addChild posit... Bjorn Schultheiss
- RE: [flexcoders] Actionscript Project - Weird addCh... Bjorn Schultheiss

