ActionScript 3.0 :: Very Simple Explanation Of Get/set?
Aug 31, 2010
I read a lot about accessors or getters/setters, but to date I cannot really understand what they do. The language describing their use is just beyond my comprehension, not being any type of developer nor an advanced AS3 user.Can someone provide, or point me in the direction of, a VERY SIMPLE getter/setter example that includes WHY it would be used as well as HOW to use it? something small that doesn't use just comments within functions (like "// here is where you do xyz"), but actual code (the actual doing of xyz). That way if I want to play with it and build on it I can.
View 14 Replies
Similar Posts:
May 31, 2010
For example, I have a function that is triggered by a button click This function loads an external swf.I then set a global variable swfLoaded to true, with the idea of having an if condition that executes removeChild(loader) if swfLoaded is true.When trying to execute removeChild(loader), I get an error telling me that it must be the child of the caller.I've seen the code below, which loads a default swf, but I don't want a default swf - I just want one loaded if the button is clicked, and then if another button is clicked, the original one to be removed before the next swf is loaded.How do I make this code work without loading a default swf, just loading one once someone clicks a button, and then removing it?
var Xpos:Number = 110;var Ypos:Number = 180;var swf:MovieClip;var loader:Loader = new Loader();
var defaultSWF:URLRequest = new URLRequest("swfs/eyesClosed.swf");
[code].....
View 3 Replies
Nov 5, 2009
What I get is that you can pass a function to another function as an argument so that the function that you pass to can "call back" that particular function.
All good. However, I'm unclear about a couple things: Why exactly is this beneficial? is this the same thing that the addListenerEvent method does when you pass it a function as an argument for when the event fires?
View 2 Replies
Aug 12, 2009
I have been reading Learning Actionscript 3.0 for about 1-2 months now on and off and i have stumbled across a paragraph that I don't quite understand concerning the position of a navigation bar buttons.
Code:
var btnNum:int = 5;
var spacing:Number = 10;
var navBar:Sprite = new Sprite();
addChild(navBar);
var btn:SimpleButton;
[Code] .....
The current button is positioned horizontally (line 10), offset by the spacing set in line 2, plus the width of the button and another spacing gap for each button in the loop. Therefore, the first button is positioned only 10 pixels to the right of the container's registration point (spacing, plus zero times the sum of the width of the button and spacing). The last button is positioned 10 pixels to the right of the container's registration point plus 4 times the width of the button and spacing. The vertical position is also set, moving the button down 5 pixels. From the above quote, I understand that the button the first button is placed horizontally, but i don't understand what is after it. What the paragraph means and how it does it's position.
View 2 Replies
Feb 8, 2005
people I am a newbie here, I need help and explanation in making a scrollbar like the one in[URL]... I know a slider and a textbox is needed but I need to know the trick behind it.
View 1 Replies
Jan 26, 2010
I just can't seem to figure out how to use them and what they're used for.
View 2 Replies
Mar 22, 2010
I'm a relative noobie struggling to understand object registration points / center points. For example, in this image of an empty movie clip from an XML gallery I'm customizing for my site, there is a circle with a cross and an empty circle.
Can someone point me to a thread or article that explains object registration points, how they relate to each other and how (and why) to move them (or not)?
View 3 Replies
Jan 4, 2007
I try to understand this code ( taken from a tuto). I am learning empty mc and AS... I catch it until a certain point, however some terms are still very very dark for me :So as far I see, there are only 2 objects in the file :An empty mc called Menuholder and a mc called menuitem ( a picture for example)I can track back those 2 objects in the code, however I can not understand what is the object "menu" doing there ???I highlighted it bellow your explanation :align = bottom;centerx = Stage.width/2;width/2;menuitems[i]._x = xpos;}};
View 4 Replies
May 5, 2009
I was curious to how gotoAndStop really functioned, so I ran a few tests. Results are highlighted for easy skim reading.On each frame, I placed a trace statement, saying which frame is currently displaying.Then, I messed around putting different kinds of code on frame 1.
Example #1
Code:
stop();
gotoAndStop(5);
[code]....
View 1 Replies
Aug 1, 2011
Flash is not in my toolset, but I am an old Director jock and have spent some hours dipping my head into the Flash manual. I suppose that makes me a promising beginner-level poster. I'm working in CS5.
I need to make a simple Flash-based sound player for a website for a newly-released novel (http://www.bearriverbooks.com/index.html). I want the user to click on what appears to be an icon (or image), which kicks open a simple controller and starts playing a sound file (a radio interview, which I will probably export using Flash's voice compression). Nothing fancy. Just want the visitor to hear the sound and be able to apply simple controls (stop/start/rewind/volume).
I can learn ActionScript, I suppose, since I used to dream in Lingo, but my life would be a lot simpler if I could just publish a controller without having to roll my own. I'd like to think there's a magic button somewhere that can do this, but I haven't found it yet.
View 4 Replies
May 26, 2010
I've finished my flash file. I created it with Flash CS3. I didn't use any scripting, dynamic stuff, etc.. It's a simple flash movie of vectors/tweening.I want to insert it in my homepage, but when I publish it, I get quite a lot of code. I've been looking around & I see some sites that have all this javascript & some that don't.Could someone help me identify the correct way to embed my .swf file? I'm not a fan of .js since it doesn't work if it's turned off in a user's browser. I want my .swf file to play as long as the visitor has Flash 8 or higher installed. And if they don't, I want to display a .png instead.[code]
View 2 Replies
Nov 6, 2009
I am having trouble doing a motion tween in CS4. I am just starting to use CS4 again after a little hiatus, I know I was able to do a motion tween like I did when I was using CS3 but I can not find how to do it again.
View 2 Replies
Jul 17, 2009
I'm building a simple soundtrack in CS4 where files are loaded externally, and played according to the frame. So on frame 5 there may be music, and on frame 9 its stopped, frame 10 will be another soundtrack, etc.
I'm trying to build the channel in CS4. I've really looked around and the correct syntax is so confusing. This is what I have so far.
[Code]...
View 1 Replies
Nov 17, 2009
I want to have 4 radio buttons Then which ever radiobutton the user has chosen I want Flash to use it later on.
[URL]
however I receive the following errors why?
**Error** Scene=Scene 1, layer=action, frame=1:Line 4: The class or interface 'fl.controls.RadioButtonGroup' could not be loaded.
var myradioGroup:RadioButtonGroup=new RadioButtonGroup("Group 1");
**Error** Scene=Scene 1, layer=action, frame=1:Line 13: The class or interface 'MouseEvent' could not be loaded.
function showResult(event:MouseEvent):void {
Total ActionScript Errors: 2 Reported Errors: 2
View 10 Replies
Jun 11, 2009
I am having trouble getting a simple animation to play properly, on a site designed by someone else, in IE. It works fine in Mozilla and Safari. In IE, on some computers, it shows up but there is a prompt about downloading a Shockwave add-on. On other computers it doesnt show up at all. Going from Mac to PC is also presenting problems. I'm freelance, so it's not like I'm in the office with these other people, so I only know what's going on with the 3 pc's I have at my disposal; which is as described above.
View 3 Replies
Sep 3, 2009
I'm trying to add a simple arrowhead to a line and I can't find the setting in CS3.
View 3 Replies
Oct 11, 2009
Draw a rectangle using the rectangle tool; select the text tool and create a text box inside of the rectangle, and type in BEGIN; make sure it fits inside the rectangle; select entire image by left clicking then dragging over it; convert to symbol button.
Then, I add in the code of going to keyframe 4 when released (which works fine). But when I test it out and mouse over the button, I can still select the text which gives me like barely any space where I can click the button to go to keyframe 4. This is reeaaallly annoying me. How can I fix this?
View 1 Replies
Nov 16, 2009
Is there a simple scene management/rendering 2D engine for Actionscript 3 there? All I need is simple engine, wich I don't have time to write on my own for. I googled and found pushbutton, but it seems to be too big for my needs. I need simple scene and rendering.
View 1 Replies
May 7, 2010
i am building iphone small games, so far using arrows to move right / left, i tried to find code to move object by accelerometer, if the iphone tilts right it goes right..
View 1 Replies
Jul 30, 2010
I am using Adobe Flash CS4. I don't know why I do the sample actionscript code here.
on (release) {
gotoAndPlay(1);
}
And now I'm dealing with a button function. I already created a box then press "F8" and choose button. Now I click on the button box, and press "F9" for the actionscript. It said that "Current selection cannot have actions applied to it" Then choose "ActionScript 1.0 & 2.0" Global Function > Movie Clip Control > On but "On" is disabled, how to solve this problem of mine to put this simple code.
View 1 Replies
Aug 10, 2011
I'm thinking about setting up a website (based on WordPress) to host video tutorials on interpreting CT scans.
In addition to simply letting the visitor view PowerPoint presentation videos, I'm keen on writing some sort of simple app that I can embed in the blog to allow the visitor to scroll through a series of images (i.e. a scan).
I usually code in REALbasic or Objective-C. What are my language options for making an interactive embeddable image viewer in a blog? The website needs to be able to be viewed on an iPad as well as normal desktop browsers.
View 3 Replies
Sep 8, 2011
I'm new to AS3 and I need some help putting something with the FLVPlayBack component together.
When I put this in the first frame of my timeline:
player.volume = 0; player._uiMgr._isMuted = true;
[Code]...
View 2 Replies
Dec 2, 2011
I have some code that loops an animation, basically I just want to add a few seconds wait before it starts again. The code is below, including the wait() function I am trying to use.[code]....
View 5 Replies
Sep 22, 2010
I have a function (event.keyCode listener, the function will start when I press the spacebar) that will add 2 movie clips on the stage using the addChild function. But I want the second movie clip to appear only 10 seconds after the first one. Somebody know how to do this? Here's my code so far, but with this code, both movie clips appears at the same time :
Code: Select all
stage.addEventListener(KeyboardEvent.KEY_DOWN, jump);
{
[code]......
View 1 Replies
Nov 3, 2008
I am going to create few dynamic texts in a flash movie. The dynamic texts shall be based on few simple variables from a php-script.
This is an example of my php:
$varone = "hello";
$vartwo = "One long message...";
echo "&one=";
[Code]....
What is the Action Script to load this two variables to two dynamic texts?
View 2 Replies
Mar 7, 2009
can someone just tell me the EASIEST way to make a text field or a buttohyperlink to another page on a site, a text anchor or another web site altogether?I don't know why Adobe has made this so un-intuitive and difficult. InDesign has a hyperlinks panel that makes it easy.I'm trying to modify a nav menu template that someone else created
View 3 Replies
May 13, 2009
How do you create a simple Health Bar for Actionscript 3.0? I have been searching for this for a while, and all I ever find are AS2 tutorials. AS2 dates back to about 900 B.C. ; it is an archaic language and it needs to be left alone, FOR GOOD.
-Snivvle
--------------------------
"AS2 is for dinosaurs" - Snivvle, 2008
"AS2 is for people who are afraid to evolve" - Snivvle, 2009
"AS2 is for people I want to punch" - Snivvle, 2009
View 5 Replies
Jun 2, 2009
Does any one have a simple horizontal scroll bar? I need a long image to scroll from left to right (no up or down)
View 3 Replies
Jul 4, 2009
I'm trying to create a very basic player for my very basic site.
View 3 Replies
Dec 12, 2006
I am creating multiple sprites on the stage using structured classes as shown below, I would like every time I click on one of these sprites to make it go on top of all previously created sprites. I would also like to know if this can be implemented from within the last class "class c" onMouseDown function.
[Code]...
View 6 Replies