ActionScript 3.0 :: The Uber-basics: Communicating Between The Stage And The AS File

Mar 17, 2009

I was pretty good at 2.0 but 3.0 has completely lost me. I've been reading up on it and getting a handle on it, but in the entire Actionscript 3 BIBLE I have not been able to figure out the simplest, key part that links it all together. How, in the name of everything that's holy, do I communicate between the stage and the "ever-necessary, more secure, more robust" AS files I'm creating? I wish I could give specific code, but I'm just looking for the guideline. If I create a function in a class, I can't call it in the timeline or a button, or even a line down from it in the AS file (call to possibly undefined method).

If I create a sprite in my AS file and then try to add it to the stage, addChild is an undefined method or function. If I create a movie clip in flash, export it for actionscript, it's undefined in my AS file. Just show me how I can write a super simple program where the thing on the STAGE interacts with the thing in the AS file, and I can take it from there.

View 9 Replies


Similar Posts:


Actionscript 3.0 :: Basics Of Papervision3d Tut Code As A Separate As File?

Feb 17, 2009

I've just been following the Basics of Papervision3D tut, which is very good by the way, the only one I've ever managed to get working.And I'd like to write the code as a separate as file, but I'm having a bit of trouble.In the class definition, what should it extend?[code]I tried everything I can think of and looked at other tuts to see what they've done but nothing works.

View 1 Replies

Flex :: Basics In For Loop In Actionscript 3 ?

Mar 23, 2011

this is my sample code

var i:Number = new Number();
trace("showarray length" + showArray.length);
for(i=0;i<showArray.length;i++){[code].....

wherenever the if is satisfied it stops looping it immediately goes out of the loop.this is a sample output given that the length of showArray is 2 and num = 0

showarray length2

equal daw0==0

alerts

View 5 Replies

ActionScript 3.0 :: Down To The Basics Button 2 Next Frame?

Jan 19, 2011

I'm trying to make flash animations w/ text. I don't know how to make buttons though so I can advance the movie. I really have NO idea so I need details on EVERYTHING past opening up a new as3 document.

View 3 Replies

ActionScript 2.0 :: Object Basics By Senocular?

Jul 27, 2004

I am only at the very beginning and I want to make certain that I go through this understanding everything that can so maybe I won't have to ask as many questions in the forums and can start answering more. In this part:The code for making a standard generic object in Flash is as follows:

myObject = new Object();

The variable myObject then becomes a object variable which can then have more variables added to it using dot syntax like so.Is myObject the actual name of the variable and the = new Object simply stating that there is a new object called myObject?

View 14 Replies

ActionScript 3.0 :: Understanding Basics Of Random Motion

Apr 15, 2011

I started out learning AS3 on my own a while ago without any programming experience whatsoever. I'm still in my diapers, but slowly progressing. Currently I'm working on a short animation with some code involved. Part of the animation is a herd of cows grazing in a pasture. I have a class called Cow which extends MovieClip and on the Cow timeline I have the walk cycle and other cow movements animated. When a cow is walking it slowly moves horizontally, along the x axis. I want the cows, when walking to also randomly move up and down (along the y axis) which would basically look as though the cow is moving further away or moving closer towards us. I'll be resizing each cow, according to its y position to create the effect of perspective (near and far).

What I'm trying to figure out is how to make the cow move either up or down the y axis in a somewhat random way. By "somewhat random" I mean that I don't want the cow to switch directions every second, but rather something like: 5 seconds moving up the y axis, then maybe 8 seconds moving down, then possibly 4 up, then 11 down, etc. It would be super if I could also have a velocity factor involved, meaning that when changing directions - from up to down, or down to up - I prefer that the change is smooth, like as in a ease out and then ease in.

[Code]...

View 2 Replies

Actionscript 3 :: Flex/Flash Builder Basics?

Mar 27, 2011

I've been trying out Flash Builder for the first time and I can't seem to get it working...

First off I have these bits of very basic code:

[Code]...

Another key problem: Flash Builder cannot connect to the debugger, even though I've installed it twice now.Can anyone help me here? I've made sure my firewall is off, but could this be causing problems?

View 2 Replies

ActionScript 2.0 :: Basics Of Calling A Function With A Variable?

May 27, 2011

I'm trying to get to grips with having a function that can accept an input that is passed to it as it is called, and then use that input in its workings.As I'm writing more code, it's becoming clear that this is something that I need to pick up, but despite reading and playing about with it, I'm still a little confused.The code is designed for a character's "level up" screen. When the button next to a stat is pressed, I want it to pass the name of that stat to the statUp function, which will increase the selected stat by one.In my main file I have this code, to call the function when the button is pressed. (In this example, it is the Strength button)

ActionScript Code:
_root.buttonStr.onPress = function()
{

[code]........

View 6 Replies

Actionscript 3.0 :: 3 XML Basics - SelectedItem On ROLL_OVER - Error #1009?

Mar 17, 2008

Is there a way to modify this tutorial to execute selectedItem on ROLL_OVER instead of click? I changed

lb.addEventListener(Event.CHANGE,itemChange);

to

lb.addEventListener(MouseEvent.ROLL_OVER, itemChange);

but when I rollover a list item I get: TypeError: Error #1009: Cannot access a property or method of a null object reference. at as3xml_finished_fla::MainTimeline/itemChange()

View 5 Replies

Actionscript 3.0 :: Papervision3D Collada Basics Tutorial Isn't Working?

Apr 11, 2009

I've been trying all day to get the Papervision3D Collada Basics tutorial to work and every time I run the file I end up with an empty black screen. No matter what I've tried i cannot get anything to show up. Finally I had the idea to download the source files from the tutorial and run those 'as is' without changing anything. When I opened the SWF created by Lee, all i saw was the same blank black screen. Has anyone else run into this? All other Flash files seem to be fine,

View 3 Replies

Actionscript 3 :: Not Understanding Basics Of Dynamic DataBinding (bindPropety) In Flex

Jun 6, 2010

I need to dynamically bind properties of components created at runtime. In this particular case please assume I need to use bindProperty. I don't quite understand why the following simplistic test is failing (see code). When I click the button, the label text does not change. I realize that there are simpler ways to go about this particular example using traditional non-dynamic binding, but I need to understand it in terms of using bindProperty.

[Code]...

View 2 Replies

ActionScript 2.0 :: Back To Basics - Tracking Mouse Coords Into An Array

Mar 9, 2004

I've been reading through all the various threads related to the drawing API and saving drawings. About a hundred times I've seen mention of "log mouse positions into an array" and stuff like that, but I can't find any clear and simple examples of how to do this.

Let's take a very simple use of the drawing object to do freeform drawing. What is the AS to capture the mouse XYs as the user draws and put that into an array. I can't figure out how to get Flash to keep updating things as I go, it invariably grabs the fist point and that's it. Could one of you AS gods just write out a super simple routine for this? I know I'm not the only one that needs this (as it seems to be asked every week) Let's use the most basic drawing example I can find:

[Code]...

View 14 Replies

Actionscript 3 - Flash Based Website Basics - First Steps - Good Practices

Jul 20, 2010

I have a bit of Flash experience, did a full featured movie player, other stuff in AS3 and got plenty of programming skills in other languages, BUT now I need to create a multi paged website. Quite easy, a few pages, some animations here and there, nothing fancy, got all the graphics.

But time is short on this one, so I need some advice about good practices (pack everything into one main MC or make separate swfs and load them in, etc.), where to begin, or what kind of book should I grab to make the job pretty.

View 2 Replies

ActionScript 3.0 :: Accessing Stage Items, Through A SWF File Which Is Loaded Inside The Stage

May 14, 2011

- I have A.fla.

-  A.fla includes buttons, movie clips and also B.swf is loaded in A.fla using a LOADER

- i want to access elements in A.fla, from the actionscript codes inside B.fla to modify those movie clips and buttons based on actions going on in B.swf
 
for instance, lets say there is a button X in A.fla, and there is a button Y in B.fla,  B.swf is loaded into A.fla, and I want the button Y to erase button X when clicked.
 
general question:  accessing elements in a stage, through a SWF file loaded into that stage.

View 2 Replies

ActionScript 2.0 :: Communicating Between Two Swf's?

Jan 26, 2010

I have a Master.swf which loads in a game, lets call it A.swf. Once the game is finished, Master.swf then loads the home page, lets call it B.swf. I have this working.

I have a progress chart in my home page which tracks the user's progress in the game (like number of successful attempts, number of items collected etc etc). If a user completes the game, and the home page is loaded, then how do I get the newly updated info to display in the home page?

View 1 Replies

ActionScript 2.0 :: CS3 Communicating With Html

Apr 19, 2009

i have seen this done where a flash file knows what page it's on by some piece of code on the html page. It could have been php or java i don't know but i would like to know how to do that. That way i create one flash nav bar and it can tell what page it's on so i can make it so you can't click the page your on.Let say i have three pages Home, About us and Contact us and build a flash navigation for it. Some where in the HTML documents there is a code that tells flash what page it is. Flash reads this info and knows "oh i am on the Home page" or "i'm on the Contact us page" and will respond accordingly.

View 2 Replies

ActionScript 3.0 :: Communicating From External Swf

May 13, 2009

Im working on a project wherein I have the main fla tied to a document class entitled MyContent. The main fla consists of buttons and textfields, etc. External swfs are loaded when the buttons are pressed. My question is what code would I have to include in one of the external swfs to allow it to be able to change the content of one of the textfields, which was assigned dynamically in the MyContent class? The code within the MyContent class consists of a dynamic text field on the stage named longDesc and a string named long1. ex:

Code: longDesc.htmlText=long1; In the external swfs I have images that are enlarged on a click event and would like to be able to have the textfield in the MyContent classed changed as each image is selected through code in the external swf.

View 4 Replies

ActionScript 3.0 :: Communicating Between Swfs?

Jul 10, 2009

Okay so i heard it was possible but im not sure.

Example: i have 1 main swf containing everything. inside that swf i load 1.swf

can 1.swf share the same vars and everything as the main swf? such as.. if i click a button in 1.swf, then something will happen in my main movie.

View 3 Replies

ActionScript 1/2 :: Communicating With Php From Another Server?

Mar 12, 2009

I use loadVars to communicate with a .php file. When theflash files is on the same domain url, let'sthe .php file the communication between flash and php works. When Iput the flash file on another domain than the .php file (somethingcommunication process doesn't work anymore

View 3 Replies

ActionScript 3.0 :: Communicating To A Loaded .swf

Jun 9, 2009

I have finally figured out how to preload, and gotten my main movie to load an external swf properly. My last hang up, is how to speak to that loaded swf, with a button added above it in the main timeline.So, my button is Nextbtn (added via addChild), and my swf is titled "about_mov.swf", when it is loaded, it goes to frame 10 and stops, what I want to happen, is when you click the NextBtn, that loaded swf advances to frame 11. Just not sure how to reference it properly, and hping i can get a quick solution on it.

View 5 Replies

ActionScript 3.0 :: Communicating Between Loaded SWF's?

Jul 19, 2009

I have a flash container that loads other flash files that have been made in Adobe Captivate, (essentially just normal SWF files) and on top of that I have other SWF widget files that I have created as it's children to extend default Captivate functionality. So essentially i have 3 'levels' of loaded SWF's.Container -> Captivate SWF -> WidgetThe problem lies in the middle - I don't know how Captivate is arranging its variables, events and loaded children since I don't have access to it's code. What I want to do, is to get my container SWF communicating with the Widget one and vice versa, but I can't get the hiearchy working... I can send values to the "stage" via the widget, but not vice versa.

So firstly, since I don't have the SWF code -- Is there a way to list all variables inside a child or parent so I can work this out?- Is there a way I can tell when a child or parent is triggering an event? (especially when I don't know the names/functions of the event)- and is there any easier way I could be going about this that i'm not seeing?

View 5 Replies

Actionscript :: Communicating With A Loaded Swf In Another Swf

Nov 15, 2010

I have loaded an AS2 swf inside another AS2 swf using MovieClipLoader. I have no control(cannot edit) over the child swf. Is there a way I can communicate with the child swf from the parent swf. The child swf is not accepting any LocalConnection Objects. Can I call a method in the child swf some other way?

View 2 Replies

ActionScript 2.0 :: Communicating From XHTML To An SWF?

Jul 26, 2009

I can successfully call ajax-like functions from my Flash header to update my page. But how can I update the SWF with calls from my page. My page is XHTML. When a link is clicked, I would like the Flash header to move to a specific keyframe.

View 0 Replies

ActionScript 2.0 :: Communicating With PHP From Different Scenes?

Nov 30, 2009

I seem to be having issues with sendAndLoad() from different scenes.When I load the .swf (ctrl+enter) the communication is fine, when I naviget to scene2, the same code doesn't seem to execute at all...

Code:
//--------HERE WE SEND THE DATA--------//
var myLv:LoadVars = new LoadVars();

[code].....

View 1 Replies

ActionScript 3.0 :: Communicating Between Swfs Possible?

Jan 20, 2010

I want to communicate between a embeded swf and the main swf. I want my main swf to tell the embeded swf to do something like gotoandplay(3)Main.swf loads Sub.swf into a empty movie clip called imageArea._mc.Is it possible to have the main swf tell my sub to do something?[code]

View 1 Replies

ActionScript 3.0 :: Use Better When Communicating With Php Server?

Jun 7, 2010

I couldn't find out which protocol, whether JSON or XML, to use better when communicating with php server and actionscript 3. The data size sent out from server to as3 could be a bit big so I need to choose depending on which one works faster.

View 9 Replies

Actionscript 3.0 :: Communicating Across Timelines

May 8, 2009

I have added an attachment to this file. What I want to happen is, when I click 'blueBtn' I would like 'pic1' to fade to alpha:0 (using TweenMax)... It seems simple enough but I just cant get it to work.On the Greensock Forum someone gave me this bit of code without any real explanation, how do I put it to use?:[code]

View 8 Replies

ActionScript 2.0 :: Two Or More Swf Files Communicating?

Oct 25, 2006

Is there a way or is it possible for twoor more swf files communicating? Example, if I have test1.swf and test.swf, test1.swf can change the variable values in test2.swf or vice versa without reloading. Is this possible? How?

View 6 Replies

ActionScript 2.0 :: Communicating Between The Swfs?

Aug 16, 2007

I have a main swf(parent) and a sub swf(child) that I have loaded into the parent swf. I am trying to make a button in the child swf effect the parent swf. I mainly want the child swf to communicate with the parent and tell it to make a movie clip visible and start to play.

View 5 Replies

ActionScript 2.0 :: Communicating Between The Levels?

Jul 18, 2008

I want to load in a new _level *.swf. This new level contains a button which will have a stop command, which I want to work with an MC in the _root *.swf level.

_level1

Code:
loadMovieNum("level2.swf",2);

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved