Friday, April 17, 2009
Transparency issues with SPRY in Dreamweaver
A simple style="background-color:#FFFFFF" will fix the problem.
Centering DIV
Centering a DIV using CSS
#content { width: 700px ; margin-left: auto ; margin-right: auto ;}
But how do you center a DIV in the center within a DIV? Say I have two absolute div and one is within the other. Both has got position set to absolute. We can do this:
<div style="width:900px;position:absolute;margin-left:-450pxtop:50px;left:50%;">
position:absolute will set the position to absolute
left:50% will set the child div to be drawn in the center
margin-left:450px will dictate that the drawn child be drawn to left by 450
Tuesday, April 14, 2009
Convertible Top Care
But before you buy any convertible car care kits, do make sure you check out if your convertible's roof is fabric or vinyl. It is different! Google about your car top material online. At least I am certain that my Z4 is Fabric :)
RAGGTOPP Convertible Top Care Kit - Fabric
PHP Debug Using TextFiles
$fp=fopen("temp.txt",'a');
fwrite($fp, $sqlCmd . "\n\n");
fclose($fp); // close file
Monday, April 13, 2009
Flex Getting Image Dimension before load complete
To overcome this, we can make use of PHP's internal function 'getimagesize'. The codes are as follows:
$file = "uploader/upload/" . $row_imageinfo['bitmapurl'];
$info = getimagesize($file);
$width = 0;
$height = 0;
list($width, $height) = $info;
echo("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
echo("<result>");
echo(sprintf("<picurl>%s</picurl>",$row_imageinfo['bitmapurl']));
echo(sprintf("<width>%s</width>", $width));
echo(sprintf("<height>%s</height>", $height));
echo("</result>");
?>
Sunday, April 12, 2009
css id and class
Usage of class and id in CSS for DIVs
.newsRowText {
color:#333333;
margin:10px;
line-height:22px;}
.newsRowText#errors {
color:#CC0000;
margin:10px;
line-height:22px;
}
<div id="errors" class="newsRowText">Error Message</div>
<div class="newsRowText">Normal Message</div>
Flex getting objects that are created
1. When we create an object, they belong to a particular container, so when we access it we need to make sure that the accessor is going in order of it. Say for example, I have a button inside the RichTextArea object, I need to do this in order to access it:
this.richtextarea.textarea.button and not just simply this.richtextarea.button
2. We can access objects created on screen in two ways.
a. When we add the objects we created via an array. e.g.
public var imgArray:Array = new Array(); // this is declared at the top of the page
for (var count:int =0; count <>
var myImage:Image = new Image();
myImage.x = 10;
myImage.y = 10;
myImage.source = "whatever.jpg";
imgArray.push(myImage);
}
b. When we add a name to the object and obtain the current Event Source of it e.g.
public function init():void {
var myImage:Image = new Image();
myImage.x = 10;
myImage.y = 10;
myImage.source = "whatever.jpg";
myImage.name = "whatever";
myImage.addEventListener(MouseEvent.CLICK, getEventName);
}
public function getEventName(event:Event):void {
var myObject:Image = event.currentTarget as Image;
// if you want to get the image Name, we can do it like this:
// var myObjName:String = (event.currentTarget as Image).name;
}