Wednesday, August 11, 2010

How to certain keyword in all your store proc?

I always need this code to find my store proc for thing like

- Table related back to a particular store proc
- I need to find certain SCR (software chage request) in all the store proc

So how do I do it? The fast and dirty way would be

---
Use MyDatabase;

SELECT Name
FROM sys.procedures
WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%Kenny%'
GO
----

Base on the example above, I'm trying to search the word "Kenny" in all my store proc and return the store proc name. Please do take note that you will not be able to find exactly as what you want in a glance. You will find problem like comment or table or variable which have the same name.

Monday, May 10, 2010

How to add hyperlink to flash button? - Flash CS4

1) Click on the button that you wish to put the hyperlink


Figure 1: Flash screen

2) Look under properties (Windows > Properties) and look at the instance name (highlighted in figure 1).

3) If the instance name is not entered (it will show like figure 1), please give it a name like “btnService “. If you are doing correctly, you will be able to see the result like figure 2.


Figure 2: The instance has a name now


4) Click anywhere on the flash screen. If you need guidelines on where to click, just click on the empty space (green box in figure 2)

5) Go to action (Windows > Actions). If there are no code in the action script, that is good. Just put “import flash.net.navigateToURL;” in the first line. If you are doing correctly, you will be looking at the figure 3. If there are already codes in the action, just find if you have the same command in it. If already exist, please don’t add the same line again.

Figure 3: MY first code
6) Let start putting the code below
--- start copy the code below ---


[btnname].addEventListener(MouseEvent.MOUSE_DOWN, [btnname]mouseDownHandler);

function [btnname]mouseDownHandler(event:MouseEvent):void {
navigateToURL( new URLRequest("aboutus.html"), "content" );
}


--- end copy ----
7) After you have copy the code into the actions, just replace all value “[btnname]” to your button name (which you have specific on step 3)
8) Change the value “aboutus.html” in the code to some url or file that you which to link to and that’s it. If you are doing correctly, you will be looking at figure 4


Figure 4: My final code