Posted by: emalik on: August 18, 2009
In this article I’m going to show how to consume a Web service and some of the pros and cons of it. When you’re done reading you should have an understanding of what data binding is, how to use it in your applications, and how to achieve similar results without using it.
Unfortunately for some, Flash Professional is required to follow along with the examples. If you haven’t upgraded Flash to the Professional version yet, taking advantage of the Web service integration and data binding might just be a good enough reason to.
What Are Web Services?
A Web service is, more or less, a remote procedure call wrapped in an XML package and typically transmitted over HTTP. You make a request to the URL of the Web service, passing in any appropriate parameters, and are greeted with an XML packet containing the result of the function call. The standard XML format for Web service messages is SOAP – Simple Object Access Protocol.
Web services can be inspected by requesting the WSDL – Web Services Description Language – of the service. The WSDL explains how to interact with the service, what methods are available, what their parameters are, etc. The WSDL format isn’t the easiest to read. Thankfully, Flash will help us out with WSDL interpretation, which we’ll see a little later.
What Is Data Binding?
Now that we have an idea what Web services are, data binding is next on the explanation hit-list. Data binding is… well, magic. Through data binding you can “glue” two separate pieces of a program together. Whenever one piece changes the other piece will automatically notice that change and update itself without any coding necessary. As an added bonus, data binding can be a one- or two-way street.
Data binding is remarkably simple to use and can be done without writing a single line of code. Because of this, it’s a blessing and a curse at the same time. It eliminates the need for you to program what could be complex interactions, but the “magical” aspects of data binding can make it a maintenance nightmare.
In the coming examples, I’ll show you how to use it, how to avoid using it, and finally make some recommendations for when data binding is appropriate.
How to bind a Web Service with Flash?
1- First make a simple web service that fetch data from data base like Sql Server 2005 and return data in objects like:-
pro[i] = new ProDetail();
pro[i].Pro_name = row[0].ToString();
pro[i].Pro_type = row[1].ToString();
pro[i].Pro_color = row[2].ToString();
pro[i].Price = row[3].ToString();
pro[i].Description = row[4].ToString();
![]()
2- Then open Flash Professional 8, and goto Window and select Components
3- then click on User interface and drop Text Area onto the stage.
![]()
4- Give Instance Name to the Text Area in Properties panel.
5- Now go to Window and click on Other Panels and select Web Services
![]()
6- Now click on Glob and give the WSDL address of web service which would be like this.
![]()
![]()
7- After giving WSDL address of web service to Glob, Flash will have all the methods, your web service have.
![]()
8- the method you want to use just Right click on it and select Add Method Call (An instance of the Web Service Connector component would be added to the stage) as shown in fig:-
![]()
![]()
![]()
9- Name the Web Service Connector component from the “Properties” panel.
Bind Web Service Result to the UI Component:
10- In order to display the results returned from the web service, you need to bind the result to the Text Area component you placed on the stage. Go to Window > Development Panels > Component Inspector. Select the Text Area component on the stage and go to the “Bindings” tab on the “Component Inspector” window. Click the “+” Add Binding button. Select “text : String” from the list and click the OK button.
11- Now click on Bound To in the Component Inspector, a window will open. Click on Web service Connector and at left side (Schema Location) select the object you want to bind with Text Area component and click OK.
12- And set Direction “In”.
13- Now bind the Web Service connector and set its Direction “out” and click on Bound To bind with Text Area in the Component Path.
![]()
14- Now create another layer and name it “Action’.
15- Now type the following action:-
green.trigger();
16- Now play your movie and see that what ever in your database, flash displays…
![]()
Posted by: emalik on: October 14, 2008
Hello to everybody, my blog is transfered to new domain www.pkpixels.com, so all latest posts are there please visit
PKpixels.com
Thanks
Posted by: emalik on: May 14, 2008
Problem
3DS max hangs,closes with or without giving any error when loading the plugin mentalray.dlz
Why it Happens.. ?
It happens because some firewall or spyware remover installed on your system block TCP port 7000 that is required by the mental ray to perform some system checks.
Solution
Disable any firewall or spyware remover permanently means it should not automatically start on system restart, you may have to change some setting in that software when you are done restart your system, then run 3DS max again… does it work….. sometime it works but not all the time like in my case.
Why it happens like that i really dont know may be some other software blocked the port ..so i did some research on that and then i installed a demo version of port explorer on my pc from
http://www.diamondcs.com.au/portexplorer
When i installed it and restarted my system, checked for port 7000 in the software it was open. So i run the 3DS max and woooooooo it fixed my problem.
I really dont know if it would work or not after the demo version expires but hope it does until i enable firewall again.
I hope this solves your problem but if not then i really cant do anything you must contact Autodesk abt this specific issue.
I think (I believe it really only needs port 7000, and Max needs a few) should allow MR to use the internal ports to do control checking on the system. But what to do when no firewall is installed in the system and mental ray hangs like in my system. May be some other software like spyware remover close some ports. In such a case I installed the demo version of Port Explorer (http://www.diamondcs.com.au/portexplorer) in my system and without doing anything in the software my max loading with mental ray infact after the demo expires. Looks strange but works.
Posted by: emalik on: March 6, 2008
Photoshop makes the CG Artists Life easier, but not all the time…. Sometime a simple task like making a dotted line in photoshop is not that much simpler as it should be. But that does not mean its that much difficult, its easier just follow the tutorial.
Open the Photoshop document where you want to place the dotted line
Select the Brush tool, shortcut is ‘B’
Open the Brushes Palette( Window –> Brushes, or F5)
Click the Brush Presets and select the Brush with some hard edges. You can select the Square brushes or Rounded on the bases of your need.
After you selected the brush type Click the “Brush tip shape”, Now here you can can see spacing slider, Slide it a value greater than 100%, in example i set it to 200%. You can also set the diameter and hardness of the brush here. You can see the Preview of the brush at the bottom
Now go to your document again and select the color of the line and then hold down the shift button and Click and drag to draw the dotted line. ( by holding down shift you can draw Straight lines)
If its not giving a desired look, Do it again and this time play with spacing, Hardness, Diameter and the shape of the brush to make a desired look..
There are also many other options available here under the Brushes palette..Do explore them.
Have a good day…
Posted by: emalik on: February 19, 2008
This is not a complete tutorial, but its just a small tip witch is extremely useful in designing process.
As most of you know photoshop is not a Vector Graphics tool, so sometime we get some weired problem like a draw a rectangle shape and its edges are not sharp as they should be. Or you draw a shape and its got blurred edges.
The solution is that just do not use the shapes where they are not necessary..for example if you want to draw a rectangle as background dont use shape rather use the Marquee Tool and the fill it with the color on new layer.
Another solution is that if shapes really makes your work easier do Rasterize them in your design. A common problem could be that if made a shape by using pen toll and given a stroke to it. Some edges get distorted ….That could be solved by Just Hold down the Ctrl Key and Click the shape layer. The outer border of the shape should get selected. Now Make a new layer and go to Select—> Modify —> Contract, and do a contract it 1px. and now fill the design with the color you want.
In this way the shape edges are sharp rather to use it as the Vector mask.
Well i hope that suggestion is useful.
Thanks
Posted by: emalik on: February 7, 2008
hi visitors some days i come across a project in which my client ask me to convert their logo in Pantone colors. So i thought why not to add a tutorial on how to do that in photoshop.
1- First open your image, if its in psd format then you should flat it.
2- Convert it to CMYK if it is not.
3- Duplicate your image and rename it, in my case its “design_pantone”
4- Go to its channel palette, you should see four channels there named as Cyan, Magenta, Yellow and black there.
5- Select Cyan,Magenta and yellow channel and delete them individually.There should only black channel left there.
6- Now Click on the new channel button as shown in the image below , a new channel named as alpha1 should be there.

7- Double Click on it and a channel option dialog box should appear.
8- Select the spot color from the option and Click the color to assign the new color.
Now For CMYK, we first select the Global value of Cyan color which is #00FFFF and then find the nearest pantone match of that color.
9- So enter the value #00FFFF in the dialog box
then click the color library button to access the nearest pantone color match, Photoshop will automatically select nearest pantone color.I use the same as photoshop selects but you can change that if you want.Click OK when you are done.
10- Now you should see the pantone color in the name field, click OK again.
There should be a cyan tone over all the picture now.
11- Make sure you selected the current pantone color channel, now go to image menu and then select the apply image.
Apply image dialog box appears.
12- In source drop down select the orignal image in CMYK, in my case that was design.
In layer there should be background
In Channel field select the Cyan channel.
blending should be set to normal.Opacity 100%
Click OK when you are done!.
Now you mapped the Cyan color to pantone, next you would repeat steps from 6-12 for mapping both the Magenta and then the yellow.
The Hex value for magenta is #FF00FF and Yellow is #FFFF00.
When you mapped all channels to Pantone…..You are done!
If you see big difference in the colors double click the channels and change pantone spot colors until you are satisfied from the result.
Save the file as PSD or DCS 2.0(eps)
At the end i want to say that this is just the one way i done my work because it gives you quite a control over the colors so you can adjust them by your self..
Thanks, Have a GOOD DAY !
Posted by: emalik on: January 23, 2008
Sometime when you import some object in 3D studio Max, its becomes slow because of the object you bring in has lot more polygons.
There could be many ways to reduce the polygons but here i am just describing one way in this post….For other ways see the upcoming posts.
Select the object and apply the Optimize modifier on it…As you do it you see polygons has been reduced..Note that this method is best for simple shapes, but for complex shapes i really do not recommend this method because it also reduces the details.
By increasing the face threshold value you can reduce more polygons, but your object can get worst. You can see how many polygons you reduced at the bottom of modifier parameter. You can pla with other setting to get the result without loosing the precious details.
Thanks and Have a good day
Posted by: emalik on: January 22, 2008
First of all what is target welding Target Welding….? It technique through which we can weld two vertex together…How to use that…? Simple Go to vertex sub level and select the target weld from there then select the vertex, click and drag to the other vertex and its done!.
Now A lot of time i use two different objects to make a shape then attach them together to make a single object, but then you need to attach the vertices together so they look complete.
Here is the point where problem occurs, when you try to connect to objects with different structure object you could not do it. Solution to that problem is shown here in this video.
Please be free to ask any sort of question …..
Thanks!
Posted by: emalik on: January 2, 2008
Just a tip on how to convert your current selection to a shape that also can be used in future as vector format.
Take the selection with your favorite method.
In my case i use the magic wand tool
After you took the selection go to path palette and press the little arrow on the top right corner, then select the “make work path“
enter the tolerance value 0.5, why..? because we want to maintain the original selection as much as possible…Note here that the value less than 0.5 is not acceptable.
Now your work path should be created..
Now go to the Edit menu and select “Define Custom shape”
Enter the name of desired shape and press OK
Now this shape is available under the Custom Shapes.
Just use it in the way you want and enjoy.
Posted by: emalik on: September 14, 2007