Skip to main content

Posts

Showing posts from August, 2011

App: Project Artificial Intelligence (P.A.I.)

This is a basic chatbot program, that has been launched to evolve itself with time. It is basically made to chat via mobile-sms. While this app uses the same core  to communicate on web. Technical details : Body : the flex 4 has been used to create the user interface for front-end. Brain : the php 5 has been used as server-side language for back-end. Memory : the xml has been used as database. Application - PAI :

AS3: Basic navigation class

Here is basic code for making a navigation class. The navigation here in is based on a counter. By taking the reference of a counter the class can be extended to achieve any type of navigation. CODE package { /** * @file CNavigator.as * @author Abhishek Kumar */ public class CNavigator { public var _Proceed:Function; private var counter:int; private var minRange:int; private var maxRange:int; public function CNavigator(min:int, max:int) { trace('CNavigator -> constructor'); minRange = min; maxRange = max; counter = 0; } public function navLeft():void { trace('CNavigator -> navLeft'); if (counter > minRange) { counter--; _Proceed(counter); } } public function navRight():void { trace('CNavigator -> navRight'); if (counter < maxRange) { counter++; _Proceed(counte

AS3: How to load child swf in parent swf at run-time

Here is a class to load single or multiple external/child swf files in the main/parent swf at run-time. CODE package { import flash.display.Sprite; import flash.display.Loader; import flash.display.MovieClip; import flash.net.URLRequest; import flash.events.Event; import flash.events.IEventDispatcher; import flash.events.ProgressEvent; import flash.events.SecurityErrorEvent; import flash.events.HTTPStatusEvent; import flash.events.IOErrorEvent; /** * @file CSwfLoader.as * @author Abhishek Kumar */ public class CSwfLoader { public var _Proceed:Function; private var swfLoader:Loader; private var swfRequest:URLRequest; private var swfPathList:Array; private var swfList:Array = []; private var swfTemp:MovieClip; private var swfCount:int; public function CSwfLoader() { swfLoader = new Loader(); swfRequest = new URLRequest(); } public function

AS3: How to load XML in swf at run-time ... Alternate version

We can load xml file into swf at run-time by using following class. Here is an alternate version of xml loading class that I'd presented in my previous post [ AS3: How to load XML in swf at run-time ]. CODE package { import flash.display.Sprite; import flash.net.URLLoader; import flash.net.URLRequest; import flash.events.Event; import flash.events.IEventDispatcher; import flash.events.ProgressEvent; import flash.events.SecurityErrorEvent; import flash.events.HTTPStatusEvent; import flash.events.IOErrorEvent; /** * @file CXmlLoader.as * @author Abhishek Kumar */ public class CXmlLoader extends Sprite { public var _Proceed:Function; public function CXmlLoader () { trace ("CXmlLoader -> constructor"); } public function retrieve (iXml:String):void { var loader:URLLoader = new URLLoader(); configureListeners (loader); var request:URLRequest = new URLRequest(iXml); try { loader.load (request); } catch

Batch File - Bulk File Remover

Have you ever faced a problem, where you need delete a particular type of files from your directory. Well I faced that while creating a zip file of a directory. The directory was downloaded from Visual Source Safe (VSS), and people who had worked with it knows that it puts an extra file that is named vssver.scc in each and every folders and sub-folders of the directory. As it was really cumbersome method to open and delete each and every folders. So I've developed a batch file for doing this. Code : attrib /s -r *.scc del /s *.scc Steps to create the batch file : Create a file with filename: del_scc.bat Open it in notepad. Copy and paste the above code in it. Save the file. Move the file to the required location, i.e., the directory from which you want to remove .scc files. Run the file by double-clicking on it. Understand the code : The first line will change the property of all the files whose extension is .scc by converting it from read-only to writable file.

App: Gil_TextEditor

I was working on an e-learning project for Gujarat government. The whole content of the project was in Gujarati language. Since nobody in our team had Gujarati background, so it'd become hard to understand or modify the content. The content team, those who were creating the xml files from the requirement documents, were facing lots of time & difficulty while Gujarati content creation process. So I'd developed this tool for making the content developer's life easier. Firstly, I'd analysed the problem, which were: Manual content creation for XML takes a lot of time. Symbols & Gujarati-text is being manually encoded that is error prone and time taking. Manual encoding requires debugging many times to ensure correctness of encoded text. Then, I looked for the worth of doing this, which were: to speed-up the XML development  and debugging  to increase accuracy to ease the encoding of symbols Finally, I had to convince my supervisor that how it fits

AS3: A class to control 'About ...' movieclip

It is well known fact that, each and every software or program has atleast About <software_name> dialogue box. Similarly if an application is made-up in flash, it should have an About ... dialogue-box. I usually prefer to show it over top of the application as a message box with a faded or dark background. To achieve this in flash, there is an  About ...  movieclip. It should be of size that covers the whole stage. There are 2 movieclips inside  About ...  movieclip: shows message related to  About ...  content fades or darkens the are behind  About ...  content By default this  About ...  movieclip will remain hidden. And on certain predefined mouse-click it'll show up. But after that as soon as user will click on the dark background area, the  About ...  will disappear. So this functionality requires only on movieclip inside the  About ...  movieclip to be linked with mouse-click event, which is the bas or background movieclip. CODE package { imp

AS3: A class to control button behavior & states

Here is a CButtonControl.as  class that'll control the behavior of a movieclip (made in flash) and make it work like a button. The movieclip should have atleast 4 frames with labels as: up over down disable These labelled frames will work as different states of the button. CODE package { import flash.display.MovieClip; import flash.events.Event; import flash.events.MouseEvent; /** * @file CButtonControl.as * @author Abhishek Kumar */ public class CButtonControl { private var Container:MovieClip = null; public var proceed:Function; private var objekt:Object = {}; public function CButtonControl(iReference:MovieClip) { Container = iReference; initializeAssets(); } private function initializeAssets():void { objekt.id = -1; Container.visible = true; Container.mouseChildren = false; Container.gotoAndStop('disable'); } public function in