I could not post any entries in the last few months because of my busy schedule & finally I got a chance to post this problem with AS3.0 while parsing XML.
While parsing XML I came through this error -
ReferenceError: Error #1065
which is kind of vague error, I could not find anything anything related to my code even after searching for hours. Finally I decided to jump into my XML & keep only few entries to test & it worked.
After sweating for hours I found the error in the XML because one of the node was missing. So guys if you are getting this error while parsing XML, jump into the XML and check your structure.
Thursday, February 26, 2009
ReferenceError: Error #1065
Labels:
ReferenceError: Error #1065
Monday, September 22, 2008
Tweening with AS3
Fellow Flash Devs,
I have finally started playing with AS3 & tried doing some experimentation with Tween class.
It's as simple as before except the classes which needs to be imported are different. So for AS3 we will import fl.transitions.Tween & fl.transitions.easing.*
Please use the code below to simply animate a box kept on the stage using Tween class-
import fl.transitions.Tween;
import fl.transitions.easing.*;
b1.buttonMode = true;
b1.addEventListener(MouseEvent.CLICK, btnclick);
function btnclick(event:MouseEvent)
{
new Tween(b1,"x",Regular.easeOut, b1.x, b1.x+50,1, true);
}
I have finally started playing with AS3 & tried doing some experimentation with Tween class.
It's as simple as before except the classes which needs to be imported are different. So for AS3 we will import fl.transitions.Tween & fl.transitions.easing.*
Please use the code below to simply animate a box kept on the stage using Tween class-
import fl.transitions.Tween;
import fl.transitions.easing.*;
b1.buttonMode = true;
b1.addEventListener(MouseEvent.CLICK, btnclick);
function btnclick(event:MouseEvent)
{
new Tween(b1,"x",Regular.easeOut, b1.x, b1.x+50,1, true);
}
Thursday, July 24, 2008
Problem with Combobox component
While working on a website for one of my client, I came across a strange problem with Combobox component.
If you try to put a Combobox in a flash & then try to load that .swf file in another flash using loadClip function of MovieClipLoader it doesn't work. You can't even click it to see the items.
After googling for sometime I found that its a bug in Flash and the work around is if you simply drag a Combobox component in your parent Flash & then just delete it from the stage leaving it in the library, it works perfectly fine.
And you can click and select any item from the Combobox embedded in the child Flash, loaded in the parent movie.
If you try to put a Combobox in a flash & then try to load that .swf file in another flash using loadClip function of MovieClipLoader it doesn't work. You can't even click it to see the items.
After googling for sometime I found that its a bug in Flash and the work around is if you simply drag a Combobox component in your parent Flash & then just delete it from the stage leaving it in the library, it works perfectly fine.
And you can click and select any item from the Combobox embedded in the child Flash, loaded in the parent movie.
Labels:
Flash Combobox Component
Wednesday, June 4, 2008
Tweening with MC Tween
After the Tween & TransitionManager Class, to make life more easier I have found MC Tween extension which can be used to tween objects such as movieclip/sound/textfield.
You just need to #include "mc_tween2.as" and use one simple command to create a new tweening. It doesn't use the MovieClip's own onEnterFrame event & It is based on time, not on frames.
Let's suppose you want to move something using an animation, to provide a smoother experience for the user. Using MC Tween, you could do:
myMovieclip.tween("_x", 100);
To download the extension or read the full documentation with examples please go to: http://hosted.zeh.com.br/mctween/
You just need to #include "mc_tween2.as" and use one simple command to create a new tweening. It doesn't use the MovieClip's own onEnterFrame event & It is based on time, not on frames.
Let's suppose you want to move something using an animation, to provide a smoother experience for the user. Using MC Tween, you could do:
myMovieclip.tween("_x", 100);
To download the extension or read the full documentation with examples please go to: http://hosted.zeh.com.br/mctween/
Labels:
Tweening Extension
Monday, May 12, 2008
Auto Save
Hi Guys,
You can enable autosaving for your flash documents in Flash by downloading and installing the extension -
Extension:Auto save extension
You can set the autosave intervals as per your needs.
This extensions is licensed under a Creative Commons License. If you choose to download it then you are agreeing to the terms in this license agreement.
You can enable autosaving for your flash documents in Flash by downloading and installing the extension -
Extension:Auto save extension
You can set the autosave intervals as per your needs.
This extensions is licensed under a Creative Commons License. If you choose to download it then you are agreeing to the terms in this license agreement.
Labels:
Auto Save Flash File
Thursday, July 19, 2007
Beauty of Tweening with Tween & TransitionManager class
Yes!!! Its true that you can tween any object on the stage without actually applying tweening in the timeline & its amazing.
I am pasting a small code snippet below for a quick reference, which generates a bounce effect for a movie clip placed on the stage.
import mx.transitions.Tween;
import mx.transitions.easing.*;
new Tween(mcBall, "_y", Bounce.easeOut, 0, Stage.height-50, 3, true);
Parameters Explained:
1. "mcBall" is the movie clip placed on the stage
2. This parameter tells the constructor that what property will change in case of tweening. "_y" means the y position of the movie clip has to be changed.
3. The effect.
4. Starting y position.
5. End y position.
6. Duration of the tween.
7. Boolean Value related to the duration parameter, which indicates to use seconds if true, or frames if false.
The Tween and TransitionManager classes are available only in ActionScript 2.0, but these classes are available in both Flash Basic 8 and Flash Professional 8.
I am pasting a small code snippet below for a quick reference, which generates a bounce effect for a movie clip placed on the stage.
import mx.transitions.Tween;
import mx.transitions.easing.*;
new Tween(mcBall, "_y", Bounce.easeOut, 0, Stage.height-50, 3, true);
Parameters Explained:
1. "mcBall" is the movie clip placed on the stage
2. This parameter tells the constructor that what property will change in case of tweening. "_y" means the y position of the movie clip has to be changed.
3. The effect.
4. Starting y position.
5. End y position.
6. Duration of the tween.
7. Boolean Value related to the duration parameter, which indicates to use seconds if true, or frames if false.
The Tween and TransitionManager classes are available only in ActionScript 2.0, but these classes are available in both Flash Basic 8 and Flash Professional 8.
Labels:
Tweening using actionscript
Wednesday, July 18, 2007
Actionscript/Javascript Communication
Now its much easier to communicate with Flash from Javascript and vice versa using ExternalInterface class.
You can create any function in Flash & then use the ExternalInterface class to register that function to call from the browser.
I am giving a step by step explanation to achieve the desired functionality.
First and foremost import the package using the statement given below -
import flash.external.*;
& then call the following function to register the function
ExternalInterface.addCallback("callASFunction", null, asFunction);
Explanation: The first parameter "callASFunction" is the name which will be used to call the function from the browser and the third parameter is the actual name of the function created in Flash. You can always keep the second parameter as null.
You can create any function in Flash & then use the ExternalInterface class to register that function to call from the browser.
I am giving a step by step explanation to achieve the desired functionality.
First and foremost import the package using the statement given below -
import flash.external.*;
& then call the following function to register the function
ExternalInterface.addCallback("callASFunction", null, asFunction);
Explanation: The first parameter "callASFunction" is the name which will be used to call the function from the browser and the third parameter is the actual name of the function created in Flash. You can always keep the second parameter as null.
Subscribe to:
Posts (Atom)
