ActionScript 3.0 :: Passing A Ref To A MovieClip

Apr 8, 2010

I have two classes, DocumentClass and Icon. In DocumentClass I am instantiating Icon and in doing so passing it a number of arguments. One of the arguments is which symbol (MovieClip) to use in front of the icon being created. The selection of symbols are found in the library panel of the .fla that DocumentClass is attached to.So for example, DocumentClass needs an icon with a symbol of a folder on it, and the name of the folder symbol is Folder.What should DocumentClass pass to Icon as an argument? Should it be a string containing the symbol name, or a reference to Folder? If it is a string, how would Icon turn the string "Folder" into the Folder object? Should all of the icon graphics be instantiated in DocumentClass first?[code]

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Passing A Variable To MovieClip?

Jul 30, 2009

I am trying to send a value from one of my xml nodes (<marker>) by declaring it in a function 'showData' as a variable 'XMLMarker'. If I trace this value (XMLmarker) it returns the right data found in the node <marker> (which is 'myMarker_mc'). However, I need to tell the stage that myMarker_mc is a MovieClip...please see the 'PROBLEM' stated in the code below.

Code:

stop();
var placesXML:XML =
<places>
<place name= "Yogyakarta">

[code]....

why do you want a variable to hold the value in the node <marker>, when that value is identical for each node, ie. it is always 'myMarker_mc', so why not just directly declare the variable 'xmlMark' as myMarker_mc. The reason is; the value in some of the <marker> nodes will soon be changing to 'myMarker_mc2' - a slightly different movieClip which I may need to call depending upon which place @name is chosen.This is the new output thrown up by the variable XMLmarkers

Code:
<marker>
myMarker_mc
<myText>

[code]....

View 16 Replies

Passing Variable Value To Child Movieclip?

Oct 26, 2009

I have a movieclip that will load an external picture from a given path, it works fine if I hardcode the picture path. In the scene I added this moveclip at runtime, but now I have problem to pass in the a string path value to the movieclip so that in can load a correct picture.

View 2 Replies

ActionScript 3.0 :: Passing String As Next MovieClip Name

Nov 27, 2010

I'm working on an adventure game and I need to find a way to pass the next MovieClip name to the function that loads it in the main timeline.

ActionScript Code:
Bowl_btn.addEventListener(MouseEvent.CLICK, BowlClick);
function BowlClick(evt:MouseEvent){
var nextMovie:String = "nameOfNextMovie";
this.parent.parent newMovieLoader (nextMovie);
}

This is all good but I can't find a way to use the nextMovie parameter in the function and load a movie from the library. I hope you can understand my explanation..

View 5 Replies

ActionScript 2.0 :: Passing Movieclip Name To Function?

May 12, 2007

Here is the code that I have right now (it obviousvly doesn't do what I want it to):

Code:#include "lmc_tween.as"
orig_x = mc_01.black_bkg._x;
orig_y = mc_01.black_bkg._y;
function buttonIn() {

What I want to be able to do is pass the name of the movie clip (ie mc_01, mc_02...) to the function, and have the function effect that particular movie clip. I had this code that didn't work

[Code]...

View 6 Replies

ActionScript 2.0 :: Passing Movieclip To Function

Oct 16, 2007

[code]how to get my target variable in my function to work? I am trying to make it the movieclip in which to make the text field.

View 2 Replies

ActionScript 3.0 :: Passing A Variable To MovieClip

Jul 30, 2009

I am trying to send a value from one of my xml nodes (<marker>) by declaring it in a function 'showData' as a variable 'XMLMarker'. If I trace this value (XMLmarker) it returns the right data found in the node <marker> (which is 'myMarker_mc'). However, I need to tell the stage that myMarker_mc is a MovieClip. 'PROBLEM' stated in the code below.

[Code]...

View 6 Replies

Flash :: Passing A MovieClip To An External Script?

Nov 4, 2010

I've created a class that contains all of the movie clips from the stage. These variables are referring to the instance's name on the stage. Everything seems fine as long as I keep all of my functionality in a single class. However, when I try to use another class to manage the properties of a movie clip, I run into resource clean up issues.

//File (MainScreen.as)
import utils.Container;
class MainScreen extends MovieClip

[code].....

View 1 Replies

ActionScript 3.0 :: Passing String Info Via MovieClip?

Jan 14, 2009

I have 190 movieclips which display various types of information. When a user clicks on a movieclip, it has to tween larger but also send a string to a method. I'll probably e.currentTarget to use one function which contains a tween and I wondered if there was a quick way to pass string info in a similar way?

So, each movieclip has it's own value which can be passed to a method which will use that value. The only way I can think of so far is to have 190 functions which send the string data to the appropriate place. I'm trying to avoid that if I can.

View 2 Replies

ActionScript 3.0 :: Passing Vars In MovieClip Heirarchy?

Jun 24, 2009

I have a bunch of nested movieclips. I set a var "foo" on the topmost clip. A child clip wants to know the value of foo: easy enough, i just call parent.foo.But what if I don't know how far down the tree the child resides in? Worse, what if foo changes every so often on new branches?My first thought was to simply add thisvar foo = parent.footo every clip, but this of course requires every clip have that line, or it breaks, and it doens'tus if a new child is inserted, or if a parent "foo" value changes.I was thinking that I could call a recursive function, where a child asks it parent, then its parent's parent, etc, for the value of foo along its particular branch...

function whatIsFoo(obj) {
if(obj.parent.foo==undefined) {
return whatIsFoo(obj.parent)

[code]......

View 0 Replies

ActionScript 3.0 :: Passing MovieClip Property Through Parameter

Jan 22, 2010

I am trying to build a static function that will allow me to do any sort of effect I want, however I would like to give it pass certain parameters but I am not quite sure how to do it. I am basically trying to write my own effects package with easing and all sorts of thing.
ActionScript Code:
public static function easeMC(targetMC:MovieClip, mcProperty, amount:Number, speed:Number){
targetMC.mcProperty = do the easing code;
}

Basically, those are the parameters im trying to pass but I don't know how I would go about assigning the property per se, like if I want the x position or the width to be the one animated. The easiest way I can think of is making mcProperty a string and then doing this:
ActionScript Code:
switch (mcProperty)
case "width":
targetMC.width = do the easing code;
case "x":
targetMC.x = do the easing code;

View 2 Replies

ActionScript 3.0 :: Passing A Simple MovieClip Reference?

May 3, 2010

I loaded a SWF and passed the reference to a Class called Portfolio:

Portfolio.as:

ActionScript Code:
package
{

[code]....

Now I keep getting one error or another. Right now, it's telling me:

TypeError: Error #1009: Cannot access a property or method of a null object reference.

I tried extending the thing but then I got a: "1203 No default constructor found in base class" error I just want to pass a simple MovieClip reference from one class to another.

View 1 Replies

ActionScript 2.0 :: MovieClip Loader And Passing Variables

Aug 21, 2010

PHP Code:
myImages_mc = myGallery_mc.createEmptyMovieClip
("myImages_mc", myGallery_mc.getNextHighestDepth());
var myMCL:MovieClipLoader = new MovieClipLoader();
var myPreloader:Object = new Object();myMCL.addListener(myPreloader);
for (var i:Number=0; i<myImagesTotal; i++) {
[Code] .....

The problem is everytime I click on the image_mc, it traces "undefined". I need to know the value of "image_mc.main" when I click the image_mc. The "main" variable should be the "i", which is the number of loops. On the loop, it traces correctly, but when I put it on the onRelease function, it traces undefined.

View 1 Replies

ActionScript 3.0 :: Set A MovieClip Return Value By Passing A String Argument

Oct 3, 2009

I'm trying to figure out how to set a MovieClip return value by passing a string argument and using that string to define the child of a given movieclip. I'm doing something wrong because I keep getting null traced instead of home_mc.[code]

View 2 Replies

ActionScript 3.0 :: Create A MovieClip Instance By Passing A String?

Dec 23, 2009

I have a problem in instantiate a movieclip in the library using a string variable.

Assuming i have the string with the class name of the movieclip like this[code]...

View 1 Replies

ActionScript 3.0 :: Flash Passing MovieClip Object As Variable

Sep 20, 2010

I'm relatively new to Flash and ActionScript and have a problem with the following code I'm putting together:

Code:
// creating a new testmclip object
var testmclip = new testmclip(); // creating a new testmclip object
/* create a new pop up menu
- sending the testmclip as var and "test" as label */
popupmenu = new Menu ([path: testmclip, label: "test"]);

I'm trying to send a movieclip object created in one class, to a different class - for the latter class to add as it's child. The code was originally Kevin Hoyts Android Component for Menu and MenuItem [URL] ... but in that the path for the menuitem was a path which loaded from url or relative path --> this I can't do with flash...I think.

View 2 Replies

ActionScript 2.0 :: Passing A Variable To A Button Inside A Movieclip?

Dec 23, 2009

I have list that is generated from a database that when click it calls a seperate movieclip in the library called comments and loads data from the database in it. I the movieclip i have buttons that I am trying to pass the data to but it doesnt seem to be working.

here is my actionscript:

getReleaseInfo_Result = function (releasesID,track1url,track2url,track3url,track4ur l) {
_root.container.attachMovie("comments", "comments", 100);
_root.container.comments._x = 325;

[code]....

View 4 Replies

ActionScript 3.0 :: Passing Parenting MovieClip Reference To Button Event?

May 10, 2010

I'm trying to reference a movieclip that's been passed through the class primary function (constructor/instance, tried both) but can't get a button event instance to recognize it. Since the button's based around an event, I'm not sure how to pass the reference. I stripped a lot of the code, but left the function sctructure as the button events are tied into a dynamic loop structure, a main reason why I can't move the buttons to a different class.

The example looks something like this:
package {
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.events.*;
[Code] .....

I'm trying to figure out how to get the site_mc reference to the button event so it can trigger other nested movieclips inside it (gallery_mc, etc). If this were AS2 it'd be a piece of cake but now I have all these invisible walls for variable passing.

View 11 Replies

ActionScript 3.0 :: Resetting MovieClip Between Levels And Passing Required Variables

Nov 25, 2010

I'm currently working on my first flash game and have managed to near enough get everything working. I can play each level individually by manually changing the variable 'level =' (to whichever level I want to play) in the actionscript. Now I need to find out the correct way to reset the movie after each level but still pass the 'currentTime' Timer variable and the 'level' variable over... Would I use variables I have saved in the init() function...

View 16 Replies

ActionScript 3.0 :: Passing A MovieClip Reference To A Function In An External Class?

Mar 25, 2010

I want to create a MovieClip, pass this MovieClip to a function in another class where it will be modified.The problem is, when I pass the MovieClip as a parameter to a function and start making changes, the changes are only made locally. The "copy" of the MovieClip inside the function gets changed, but the "real" MovieClip back in my main game class remains unchanged. Here's the code from my Main class:

Code:
var resourceLoader:ExternalResourceLoader = new ExternalResourceLoader();
var myMovieClip:MovieClip;[code].....

View 4 Replies

ActionScript 2.0 :: Passing Flashvars, Params And Attributes To Swf File Loaded In Movieclip?

Mar 14, 2011

I just saw a flv player that was done in AS2.I wanted to know whether it's possible or not and how I could pass the needed flashvars, params and attributes to the flv player (swf file) once I load this flv player in a movie clip with the method loadclip.

View 0 Replies

ActionScript 2.0 :: Passing Values In A Variable In A Movieclip To Objects On Main Frame?

Jul 11, 2010

im trying this every which way.creating global variables etc.I have a movie clip with a text area (lets call it txttest)there is text inside it which i want to send from this movieclip on the main frame to a text area (lets call that one txttestB) on the main frame. Whatever i try i get undefined in the text area on the main frame.I have tried this...

_global.selectedcompany = txttest.text;
_root.txttestB.text = _global.selectedcompany;

View 1 Replies

Flash :: Passing A "control" As Parameter Vs Passing Id Of The Control?

Jan 2, 2012

1) Passing a control itself as parameter into a function 2) Passing an id ( managed manually) of the control as a parameter into a function . Say for an array of controls I have ctrl_Array = [ my_btn, my_mc, my_dtg ] and corresponding id_Array[0,1,2] PS: If my question is difficult to understand, i just wanna know, if it is a good programming practice to pass control references among the classes as function parameters ?

View 1 Replies

CS3 Passing A Variable Through A URL Into A SWF

Aug 22, 2009

I have a flash file that has an XML driven menuing system to select and play various FLVs. I want to be able to craft different URLs to open the swf and start playing different FLVs. (The others will be accessible from the menu once the sfw is opened, but I am looking to control what plays on opening, dependent on what link a user click.) Not really sure about the best way to get the selection into the swf.

View 4 Replies

Actionscript 3 :: Passing Var To Php?

Jul 28, 2011

This is my php code to check how many time the page is calling.

if($_SESSION['test']==''){
$_SESSION['test'] = 1;
echo " cond 1 ";
}

[code]....

My problem is , I am calling the php page only once, but it is calling the page 2 times.

View 2 Replies

IDE :: Passing Vars From A SWF To New SWF?

Feb 26, 2008

I think this should not be a big deal, but I do not get it to work. I got a "MainFlash" witch loades an XML with about 60 variables (Settings), in base of a paramater then this "MainFlash" loades another "FlashMovie" and this one needs, all, the same Variables too.

How do I properly pass all the Vars in the new/other "FlashMovie"?

U need to know I use LoadMovieNum to Level 0 I do replace the "MainFlash", cause the new loaded "FlashMovie" can have a completly different height and width ( ...I don't think it's possible to change the Document-Setting in a compiled swf, or is it? If this is possible I would not need to load a separate swf to Level 0. the main SWF usually ist about 320x180, the following can be 2x, 3x bigger...

View 2 Replies

ActionScript 2.0 :: Passing XML To Another Swf

Aug 28, 2008

I have my thumbnails loading into one swf and I have another swf on the same page which I want to display the larger image from the thumbnail which is clicked.

I am trying to use local connection - but I am getting stuck on passing the xml or allowing my larger picture swf access to the function which displays the larger image.

It all works fine both larger image and thumbnails in the one thumbnail swf. But this is what I want to break apart into two swf's if possible??

how to pass xml functions which displays images through local connection.

View 1 Replies

ActionScript 2.0 :: F 8 - Passing Variables From One SWF To Another?

Feb 8, 2009

I have a swf with an input text box and a button. When the button is clicked, I need it to open another swf in a new window on a different domain and pass the variables to a dynamic text box in the new window. I looked at local connect but I wasn't sure it would work because the two windows wouldn't necessarily be loaded at the same time and they are on different domains.

View 4 Replies

ActionScript 2.0 :: Passing Variable To Url?

Aug 17, 2009

I have a site that uses an user id that needs to be passed from links with a flash banner. I have it working, but not the way I need it and could use a little assistance.

[Code]...

View 4 Replies

Passing Variables Between .swf Files?

Sep 9, 2009

I am loading images into a movie clip dynamically from an XML file. Based on what image the user clicks, I would like to be able to open a separate window, displaying a different image. Ideally, I'd pass the variable of which image was selected to the new open window.I've done some research online, and am thinking I'm making this harder than it needs to be.

Actionscript from main movie

Code:
chosenImage.onPress = function() {[code]......

I've also seen where I could possibly pass a variable through ASP.NET, but am experiencing the same errors when trying to pass the variable. I suppose I could embed the popup.swf file in a new .aspx page, that would probably be acceptable.

View 1 Replies







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