Theme 1
Instruction:
1. Download Theme 1
2. Extract files from downloaded .zip file.
3. Find there AS3.xml
4. Open FlashDevelop, on top menu click Tools>Application Files>go to Settings folder>go to Languages folder
5. Change existing AS3.xml to your downloaded AS3.xml file (you can save existing AS3.xml file somewhere if you will not like new scheme you can come back old [...]
HighlightSelection plugin to highlight all words matching your selection. For example if you want hightlight all ‘function’ words you need double click to ‘function’ word.
You can download HighlightSelection plugin, extract to your pc and put .dll to C:\Program Files\FlashDevelop\Plugins.
I find this plugin here.
Instruction:
1. Please download QuickNavigate plugin.
2. Extract files.
3. Copy QuickNavigate.dll to C:\Program Files\FlashDevelop\Plugins
4. Restart your FlashDevelop
What you can do with this plugin:
1. Quick open file (Ctrl+R)
- searching files through all source paths
- doesn’t show files in .svn, .cvs, .git folders
- searching by abbreviation (type “FC” for find FooCommand)
2. Quick outline (Ctrl+Shift+O)
- quick search member/method in [...]
Please read more about folding first.
Download plugins for folding:
Fold
Instruction how to add this plugin:
1. Please download Fold 0.2 to your PC.
2. Extract files.
3. Copy Fold.dll to C:\Program Files\FlashDevelop\Plugins
4. Restart or open FlashDevelop
5. Open your .as file and try to enter Alt+1, Alt+2, Alt+3, Alt+4 etc.. and you will see how folding your code. Please see [...]
Everyone use symbols ( /* code here */ ) and ( //code here ) to comment your code. But how to do it in FlashDevelop?
If you want use line comment pls do this:
1. You can select line or just put cursor to this line and enter Ctrl+q on your keyboart and you line code will [...]
Problem
Need to control sound with a play button, stop button, volume up and volume down.
Solution
Use SoundChannel and SoundTransform.
Detailed explanation
var req:URLRequest=new URLRequest(”sound.mp3″);
var mySound:Sound=new Sound;
var myController:SoundChannel;
var myVolumeControl:SoundTransform;
mySound.load(req);
mySound.addEventListener(Event.COMPLETE, mySoundLoaded);
function mySoundLoaded(event:Event):void {
myController=mySound.play();
myController.stop();
myVolumeControl=myController.soundTransform;
play_btn.addEventListener(MouseEvent.CLICK, playMySound);
stop_btn.addEventListener(MouseEvent.CLICK, stopMySound);
upVolume_btn.addEventListener(MouseEvent.CLICK, volumeUp);
[...]
Problem
Need to create a preloader
Solution
Using Math.round(event.bytesLoaded / event.bytesTotal *100);
Detailed explanation
var req:URLRequest=new URLRequest(”img.swf”);
var myLoader:Loader=new Loader ;
function imgFileLoaded(event:Event):void {
addChild(myLoader);
}
function preloader(event:ProgressEvent):void {
var percentage:Number=Math.round(event.bytesLoaded /
event.bytesTotal *100);
preloader_txt.text=String(percentage) + “%”;
}
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
imgFileLoaded);
myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,
preloader);
myLoader.load(req);
Source:
Creating_a_preloader
Problem
Need to load an image to the stage
Solution
Use URLRequest, Loader and addChild.
Detailed explanation
var req:URLRequest = new URLRequest(”dog.png”);
var myLoader:Loader = new Loader();
myLoader.load(req);
addChild(myLoader);
Thank you for reading, source you can find in attached file.
Source:
Loading_bitmap
Problem
Start and Stop sound with buttons.
Solution
Using URLRequest and events
Detailed explanation
var req:URLRequest=new URLRequest(”sound.mp3″);
var mySound:Sound=new Sound ;
var myController:SoundChannel;
mySound.load(req);
mySound.addEventListener(Event.COMPLETE, mySoundLoaded);
function mySoundLoaded(event:Event):void {
play_btn.addEventListener(MouseEvent.CLICK, playMySound);
stop_btn.addEventListener(MouseEvent.CLICK, stopMySound);
}
function playMySound(event:MouseEvent):void {
myController=mySound.play();
}
function stopMySound(event:MouseEvent):void {
myController.stop();
}
Source:
play_stop_sound
Problem
Hide a MovieClip after 2 seconds
Solution
Using setTimeout function.
Detailed explanation
my_btn.useHandCursor=true;
function hideBall() {
my_mc.visible=false;
}
my_btn.addEventListener(MouseEvent.CLICK, deleteBall);
function deleteBall(event:MouseEvent):void {
setTimeout(hideBall, 2000);
}
Source:
delay