Saturday, June 27, 2009

Flash Flex SDK-EventListener Part 3

This example is to make a small ball move in your page using your mouse. See my previous post for building this file using Ant in Eclipse. Paste this code in your .as file and compile it using your build.xml file. You can change the values in the drawCircle methods to change the radius of how big you want the circle to be. When you move your mouse, the ball will move with it in a circle. This example shows you how you can use your mouse to move an object using flash. Always make sure the name of the file that you paste this code in is the same name in this code. If you paste this code in a file with a different name, make sure you change the class name here from main4 to the new name. You also need to change the constructors name which is also called main4.


package {
import flash.display.Sprite;
import flash.events.Event;

public class main4 extends Sprite {
private var _sprite:Sprite= new Sprite( );

public function main4( ) {
_sprite.graphics.beginFill(0xffffff, 100);
_sprite.graphics.drawCircle(0, 0, 25);
_sprite.graphics.beginFill(0x000000, 100);
_sprite.graphics.drawCircle(20, 0, 5); //changin 20 can change radius
_sprite.x = 100; //location
_sprite.y = 100;
addChild(_sprite);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}

public function onEnterFrame(event:Event):void {
var dx:Number = mouseX - _sprite.x;
var dy:Number = mouseY - _sprite.y;
var radians:Number = Math.atan2(dy, dx);
_sprite.rotation = radians * 180 / Math.PI;
}
}
}


(Part 4 coming soon)

Read more...

Thursday, June 25, 2009

Triviala.com is a fun, free to play Trivia and Quiz site.

Logo_and_hills
Are you interested in challenging your mind? You might be interested in a Trivia Game where you can challenge your mind against people all over the world. There are different types of games that you can play such as the “Coin A Word” game. This game will have you create words from letters. If you are able to spell the word TRIVIALA, you can win 40 crowns. The good thing about winning these crowns is that you can use them to enter contest where you can win some actual money. They have drawings every week. The Fun trivia game “Quiz Mania” will allow you to prove your skills against your friends, family members and other players. There is another game called “Quickfire” which gives you trivia questions rapidly where you can hopefully become the Quickfire Champion. Another game called FaceOff will allow you to prove your skills on an international stage. The Jackpot game will allow you increase your crowns by answering one Jackpot trivia question. So what are you waiting for? If you are looking for an exciting Trivia Game to play, you need to checkout Triviala. This game will keep you very occupied for hours.
Post?slot_id=40795&url=http%3a%2f%2fsocialspark

Read more...

Monday, June 22, 2009

SweetDev Part 7 Simple Tree

You can create trees using the SweetDev library. This is an example of a simple tree.



You need to make sure you have the correct libraries in your application. Other than the sweetdev libraries, you also need jdom-1.0.jar, ezmorph-1.0.1.jar, ehcache-1.1.jar, asm-1.5.3.jar, json-lib-2.1-jdk13.jar, js-optimizer-core-2.1.3.jar and cglib-2.1_2.jar. If have other versions of these libraries, you might receive a conflict. So you need to delete the other version, and add these versions instead. You can get these libraries from the SweetDev example war file that you should have downloaded. It would be in the lib folder.





Add this code in your action class.

//*****************for sweetdevview
request.setAttribute("collection",userList);


List nodeTypes = new ArrayList(3);
nodeTypes.add(new NodeTypeBean("File", true, "ideo-tre-file",
false, true, false, "switchGroup"));
nodeTypes.add(new NodeTypeBean("Folder", false, "ideo-tre-folder",
false, false, true, "switchGroup"));
request.setAttribute("nodeTypes",nodeTypes);

NodeModel root = new NodeModel("root", "My First Root tab", "Folder");
NodeModel level1 = new NodeModel("folder0", "My zero folder", "Folder");
root.addChild(level1);


NodeModel level11 = new NodeModel("folder1", "My first folder", "Folder");
level1.addChild(level11);

NodeModel level12 = new NodeModel("folder2", "My second folder", "Folder");
level1.addChild(level12);


NodeModel level111 = new NodeModel("file1", "My 1st file", "File");
level11.addChild(level111);

NodeModel level112 = new NodeModel("folder3", "My third folder", "Folder");
level11.addChild(level112);

NodeModel level113 = new NodeModel("folder4", "My folder childless", "Folder");
level11.addChild(level113);

NodeModel level114 = new NodeModel("file2", "My 2nd file", "File");
level11.addChild(level114);
NodeModel level115 = new NodeModel("file3", "My 3th file", "File");
level11.addChild(level115);

NodeModel level121 = new NodeModel("file6", "My 4th file", "File");
level12.addChild(level121);
request.setAttribute("tree",root);



This will be the code in your jsp page.


<%@ taglib prefix="ria" uri="http://sweetdev-ria.ideotechnologies.com" %>
<%@ page import="java.util.List" %>
<%@ page import="com.ideo.sweetdevria.taglib.tree.model.NodeModel" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<title>Tree Example</title>
<ria:resourcesImport/>
<style type="text/css">
.ideo-acc-mycontent{
border : 1px dashed #CCDAFF;
}
</style>
</head>
<body>
<br></br>
<ria:tree id="treeajax" displayedLevels="1" nodeTypes="<%=(List)request.getAttribute(\"nodeTypes\")%>" nodes="<%=(NodeModel)request.getAttribute(\"tree\")%>"></ria:tree>

<br/>

</body>
</html>




(Part 8 coming soon)

Read more...

Thursday, June 11, 2009

SweetDev Docking a Window Part 6

Another thing that you are able to do with the SweetDev tool is to create docking windows.
In this page, you have three windows that you have created. You can set an attribute that will allow you to minimize the window or expand the window. The big advantage is that you are allowed to move the window to a new location on the page. See following screen shot.

You can see that the programmersweblog page has been moved to a new location.

Here is the code that would create these docking windows for your jsp page.





<%@ taglib prefix="ria" uri="http://sweetdev-ria.ideotechnologies.com" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<title>Docking Example</title>
<ria:resourcesImport importResources="true"/>
<style type="text/css">
.ideo-acc-mycontent{
border : 1px dashed #CCDAFF;
}
</style>
</head>
<body>
<br><br>
<ria:dockinglayout spliterStyle="background-color : black;"
minWidth="200" minHeight="20" height="600px" width="90%">

<ria:dockingcolumn width="58%" styleClass="blue">

<ria:newwindow id="window2" title="The Programmers Weblog"
url="http://www.theprogrammersweblog.com/" message="Programmer" maximize="true" minimize="true"/>
<ria:newwindow id="window1" title="Google"
url="http://www.google.fr" message="Google Page" maximize="false" minimize="false"/>
</ria:dockingcolumn>

<ria:dockingcolumn width="20%" styleClass="red">
<ria:newwindow id="window3" title="Custom content" maximize="false" minimize="false">
Hello World !!
</ria:newwindow>
</ria:dockingcolumn>

<ria:dockingcolumn width="38%" styleClass="yellow">
</ria:dockingcolumn>

</ria:dockinglayout>
<br/>

</body>
</html>



The custom window will allow you to put the data that you want in the window.

Go To Part 7

Read more...

Cancer Caused by Asbestos Exposure

Do you know anybody who was exposed to Asbestos? Asbestos exposure has been linked to lung cancer called Mesothelioma. People who are shipbuilders, construction workers, auto mechanics, contractors and demolition experts are people that might have been exposed to Asbestos. Many of the manufacturers of asbestos have gone bankrupt over the years. The manufacturers of Asbestos new of the dangers but continued to manufacturer it. If you or someone you know has been exposes to Asbestos, you should contact an experienced Mesothelioma Lawyer who can help you get the compensation that you deserve. There are different test that can help you get diagnosed for Mesothelioma. A chest x-ray is often the first imaging test to detect Mesothelioma. You can also get a CT scan, a MRI, and a Position Emission Tomography (PET) test. All of these tests can help you diagnose if you have Mesothelioma. If you have been diagnosed, you are going to need strong family support, expert medical advice, and professional assistance. That is why you need to contact a Mesothelioma Lawyer for help. So what are you waiting for? If you need compensation because you have Mesothelioma, you should call Mark & Associates, P.C. now for help.

Post?slot_id=39805&url=http%3a%2f%2fsocialspark

Read more...

Wednesday, June 3, 2009

Ready to join the ranks of 5 Minute Mystery's Top Sleuths?

If you are looking for a challenging game that doesn't take a lot of time, then you should checkout online 5 minute mysteries. These are short, challenging mysteries that you can play online. They are becoming pretty popular to the point where ABC did a news cast about them at their website abcnews.go.com/video/playerIndex?id=6195288">abcnews.go.com/video/playerIndex?id=6195288. They post different mysteries daily to give you a wide variety of mysteries to play from. To solve a mystery, you first will need to choose a clue carefully. You then will choose your suspect, and attempt to solve the case. You can play these games for only $9.95 a year which is a great price. Today's mystery is a mystery that happens at the detective's office. They have another mystery called, “Rhyming President's Mystery” that contains clues within a rhyme. To get started solving your mysteries, you can visit the website and read the instructions. You will also need to sign up to obtain a login and password. If you become one of the Top Sleuths, you will be listed on the “Top Sleuths” board on their website. So what are you waiting for? If you are a mystery lover, then you need to checkout 5 minute mystery and start solving your mysteries today.

Post?slot_id=

Read more...