ActionScript 2.0 :: Referencing Dynamic Instances - Can't Get OnRelease Part To Work

Mar 11, 2004

I'm using duplicateMovieClip to create instances of a clip. Then I use an array to name the clips. In the scrip that duplicates and names them, I also have an onRelease function to make the mcs do something when you click them. I can't get this onRelease part to work.

I need to:
- swap the depths
- load some text
- attach a movie from the library

I can't see any errors with my script, so I hope someone can look at it and give me a clue. The part I'm having trouble with is:

[Code]....

View 1 Replies


Similar Posts:


ActionScript 2.0 :: Can't Get OnRelease Part To Work

Mar 11, 2004

I'm using duplicateMovieClip to create instances of a clip. Then I use an array to name the clips. In the scrip that duplicates and names them, I also have an onRelease function to make the mcs do something when you click them. I can't get this onRelease part to work. I need to:[code]

- swap the depths
- load some text
- attach a movie from the library

View 1 Replies

ActionScript 2.0 :: Dynamic Referencing On OnRelease?

Oct 24, 2008

The following code is my attempt to fade out current clip then to fade in selected clip via one onRelease command. Here's the code. Can someone set me straight?

Code:
import gs.TweenLite;
import gs.easing.*;
var whoIsOn:Number = 0;
var clip:Array = ["orange","cranberry","melon","mango"];

[code].....

View 1 Replies

ActionScript 2.0 :: Referencing Part Of A Location?

Feb 10, 2011

How do I reference the "month7" part of this output?

_level0.box6.month7

I want to say "if that part of the string == month7 then do something".I'm duplicating some boxes and attaching some MCs to them and when you click one I want to check if what's attached is correct. (that's vague I know, but not entirely relevant).

Code:
for (var i = 0; i < months.length; ++i)
{
duplicateMovieClip(myButton, "box"+i,i+1);[code]......

View 7 Replies

ActionScript 3.0 :: Referencing Instances Of An Object?

Jun 1, 2009

referencing instances of an object in AS3

I want to be able to build a navigation and reference each navigation item separately changing each instances properties depending on rollover actions etc.

I would have thought that once the name is assigned through the for loop that would stick, eg. the following code would create 3 vars called navItem, each with the name 0, 1, 2. But it seems if I trace the name outside of the for loop each is called 2. I think Im misunderstanding something really simple!

public function buildNav():void {
for (var i=0; i <itemNum; i++){
var navItem:NavItem = new NavItem ();

[Code]....

View 2 Replies

ActionScript 3.0 :: Referencing Instances In Loaded Movie?

Apr 30, 2009

The following code gives me an error:1119: Access of possibly undefined property sp1 through a reference with static type flash.display:Sprite.Not sure how to get around this issue...  these things used to work in as2, I guess not anymore in as3...
 
---------------------------------------------------------------------- ------------------------------------------------------- loader = new BulkLoader("timelineLoader");loader.add(ExternalFiles.TIMELINE_SWF);loader.addEventListener(BulkLoader.COMPLETE, onCompleteHandler);loader.start();

[code]....

View 4 Replies

ActionScript 2.0 :: Referencing Instances Created With AttachMovie?

Jun 8, 2007

I have a situation where I create many instances of an MC, one for each node in an XML file (using a for loop), using attachMovie.

Code:
var photo_mc = _root.center_mc.photosLevel1_mc.attachMovie("photoFrame_mc", photoName, itemCount);

[code].....

View 7 Replies

ActionScript 2.0 :: Flash8 OnRelease Doesnt Work?

Nov 16, 2009

I have a mc that you should drag to the right mc.The mc that you have to choose from are sometimes a little close so I made a code that the mc that you drag will xscale so it will be smaller.But then if I press on the end of the mc before dragging the mc is outside the mouse and you cant use the OnRelease code.How to avoid that.Enclose a small fla, and the code is:

function god ( t,t1,t2){
t.onPress = function(){
this._xscale = 20;[code].......

View 2 Replies

ActionScript 2.0 :: [MX2004] Can't Get The SubItems To Work With The OnRelease Function

Feb 12, 2004

I'm attaching my new xml menu .The problem is that I can't get the subItems to work with the onRelease function.

View 1 Replies

ActionScript 2.0 :: Changing OnRelease To OnRollover Doesn't Work?

Mar 14, 2005

I need a rollover function and so I changed onRelease to onRollover but the rollover effect then doesn't work.

- Script is on seperate layer (on root)

- hit_mc is the movie clip on which the rollover should work

- mask_mc is the one that should tween when mouse goes over hit_mc

hit_mc.onRollover = function() {
tweenBall(mx.transitions.easing.Regular.easeOut);
};

[Code]....

View 9 Replies

ActionScript 2.0 :: Listener In Order To Make OnRelease Function Work?

May 20, 2007

Do I have to use a listener in order to make the onRelease function work? Right now it doesn't and I think it's because the png isn't loaded before the onRelease function is invoked.[code]

View 3 Replies

ActionScript 3.0 :: Reference Instances From Movie Clips If The Movie Clip Referencing From Is Nested?

Mar 23, 2010

It's me again and I'm running into a problem. So, I have this movie clip that is nested inside multiple movie clips. I want to tell Flash to perform an action when that movie clip hits another movie clip in the main timeline. It's just collision detection for a game using the hitTestObject code. I was thinking of using MovieClip(root), but that won't work since it's nested so much.

View 15 Replies

ActionScript 3.0 :: Distance From Point To Point And Referencing Other Instances Of The Same Class

Feb 8, 2009

I'm creating a game in flash for a university project, and learning actionscript and programming as I go. I'm very much still at a beginner level - at the moment al I have is some actionscript for drawing rectangles and moving them about the screen. This is what I'm having trouble with at the moment: I have a class called 'Creature', and I want instances of it to interact with each other. I want them to do something when they come within a certain distance of another instance. And I want them to be able to pick a random other instance to get the location of, in order to do something with that information.

What I think I need is: A function for telling the distance between two (x,y) points.
A way of referencing the nearest other instance of the class. And a way of randomly selecting from all of the instances of the class.

View 4 Replies

ActionScript 2.0 :: OnRelease On Dynamic Mc [MX2004]

Feb 12, 2004

The problem is that I can't get the subItems to work with the onRelease function.

View 1 Replies

ActionScript 3.0 :: When Change The Publish Setting , Part Of The Script Does Not Work?

Mar 13, 2009

I downloaded this free flash website template for building my website, all the actionscript in the template in AS3, i tried using xml flash - photogallery (for which i found the tutorial on this website.) in my website, but while publishing the site, it gives error, i guess it might be compatibility issue as the script that i found on the website might be in AS2 and that might be clashing with AS3 script of the template. Coz when i change the publish setting to AS2, the AS3 part of the script does not work. Individually both script in their respective separate files work but when combined together the site goes bonkers. as i want the photogallery part exactly as it is shown on this site which is with the thumbnail preview.

View 1 Replies

Flash :: Dynamically Assign OnRelease To Movieclip With Dynamic Url?

Jan 17, 2011

Sure this will be a simple fix, and I'm just not seeing the wood for the trees. I have a movie with a movieclip called scroller_mov. Inside it are 15 movieclips named pic1 thru pic15.

My code is on one frame, on the same level as scroller_mov. Just want to dynamically assign a click action to the pic1 - pic15 movieclips! have tried hardcoded links and dynamic, but no joy! Everything else works fine.

[Code]...

View 1 Replies

ActionScript 2.0 :: Dynamic Image .onRelease Not Working Correctly?

Apr 22, 2009

I am trying to load images into movie clips then add a .onRelease to then dynamically so that when a user clicks on one it will pop up a bigger image of what they clicked on in a box.The images load in just fine but when i click on them i get nothing. Here is the code:

Code:
var tdata:String;
var submitListener:Object = new Object();
submitListener.click = function(evt:Object) {

[code]...

View 1 Replies

ActionScript 3.0 :: Use Dynamic Referencing To Cut Down On The Number?

Sep 22, 2010

I'm making a flash game in which I need to spawn movieclips and I am attempting to use dynamic referencing to cut down on the number of lines I need to write.

[Code]...

View 7 Replies

Multiple Instances Of Button Won't Work

Sep 6, 2011

I have a set of two buttons on frame 1.I am attempting to use the same set of buttons on frame 5.I copied the buttons with instance names from the first frame and placed them on the fifth frame, but they are not performing the designated actions.The buttons work fine on the first frame, so I know the buttons are functional.

View 4 Replies

ActionScript 2.0 :: ADD OnRelease Method On Movieclip That Already Has A OnRelease Meth

Feb 10, 2010

Is there a way to ADD onRelease method on movieclip that already has a onRelease method? Without replacing the first one.

ActionScript Code:
mc.onRelease = function(){
trace('1');
}

I was thinking this, but it doesn't work

[Code]...

View 1 Replies

ActionScript 3.0 :: Referencing A Dynamic Textfield From A Class

May 25, 2010

how do I reference a dynamic text field in my fla file from a class which isn't the document class? For example: I have an fla file called main.fla which contains no actionscript and has a single dynamic textfield called "text_txt" on the main timeline.

[Code]....

View 8 Replies

ActionScript 2.0 :: Referencing A Dynamic Movieclip (button)

Oct 15, 2009

how do I reference a button that has been loaded dynamically?Furthermore, is it possible to use the removeMovieClip() method with a button that is inside the movieClip you are trying to remove?Simply put, I've got a movieclip that is loaded via the "attachMovie" method. There is a button inside that says "Close". I am trying to use the removeMovieClip() method on that button, but it's not working. I can put a button on the stage, and use the same method, but it doesn't work.

View 4 Replies

ActionScript 2.0 :: Tweening With Dynamic Movieclip Referencing?

Oct 22, 2009

First of all: this is my first post at actionscript.org *happysound*. I'm working on this flash gallery since a couple of days and something is drinving me crazy in actionscript.

The concept: in this part of the flashfile i'm loading thumbnails in dynamicly created movieclips on stage (1.jpg, 2.jpg, 3.jpg). Everything is working fine, but now I wanted to add some fancy fading when the loading of a single thumb completes. For some reason I can not get the tweening class working and I'm sure it's a problem with the referencing to the clip. I know this cause when I change "thumb"+i to thumb1 it is working. Googled for hours without result..

[Code]...

View 5 Replies

ActionScript 3.0 :: Referencing A Dynamic Textfield From A Class?

May 25, 2010

how do I reference a dynamic text field in my fla file from a class which isn't the document class?

For example:

I have an fla file called main.fla which contains no actionscript and has a single dynamic textfield called "text_txt" on the main timeline.

My class file is called aClass.as and is the following:

package
{
public class aClass extends MovieClip
{

[Code].....

View 1 Replies

ActionScript 3.0 :: Dynamic Referencing Of Items Within MovieClip?

Feb 19, 2010

I am building a drag and drop application. I have a few items within a movie clip that are movie clips. They each have their own instance name.

I am trying to access them from the document class using 'event.target.name'.

That works and I can pick up the name of the movieclip.

I put it in a string var called tName.

Then I try to modify a property of the selected movieclip:

itemList.items.tName.x+=23;

thats when i get, 'A term is undefined and has no properties' error.

I know itemList.items.tName is the correct navigation to the clip, because if i replace the var and hard code the correct name, it works.

whats funny is my tName var is tracing out the correct name of the movieclip.

Or a better way to dynamically access mc's within mc's.

View 1 Replies

ActionScript 2.0 :: Can't Get Any RemoveMovieClip Functions To Work On New Instances

Feb 25, 2004

Worked on this for a while, does the jpb, but because of the way I have done it, I can't get any removeMovieClip() functions to work on the new instances.need it cleaned up an in a way that I can use a removeMovieClip on it and have it actually remove them all.[code]I have almost the same code in three different frames, just using different instabnces as the basis for the duplication, and another layer that has a timer, when timer runs out, takes you to the scoreboard, now all was working well before i changed it to duplicate function, I just pulled them in from the library, but they weren't all the same size an crap (for perspective) But now ehn I get to the scoreboard, the darn things are still running.

View 3 Replies

ActionScript 2.0 :: Only The Percentage / Part Of Preloader In Dynamic Txt Box

Aug 22, 2009

break down preloader into smaller sections so i can understand it better , load a preloader but without the preloader bar graphic and preloader code of the bar and graphic, just see how to transfer the percentage of the movie which has loaded, and by showing the result in the dynamic percent_txt box on stage this preloader i am realy am finding difficult but i so need to understand the concept var percent:Number = Math.floor(_root.getBytesLoaded()/ _root.getBytesTotal()*100);

View 9 Replies

ActionScript 2.0 :: Formatting Only Part Of A Dynamic Textfield?

Aug 24, 2010

I'm having a hard time with dynamic text field formatting and I'm hoping that someone can shed some light on what the problem I'm having is.My understanding is that you can do some basic formatting of dynamic fields if you set them to render html ie the little <> button. So, I have an array containing a set of strings, which contain something akin to "<b>some text</b> the rest of the text" The problem I am having is that the text is not showing up as bold. In fact the text inside the bold tag is not showing up at all.Doing a search I came across the TextFormat(), but that appears to only be useful when formatting an entire textfield and not a portion of the whole field.

View 2 Replies

ActionScript 2.0 :: Dynamic MovieClip Referencing Using Array Notation

Feb 23, 2009

I know that a dynamic mc can be referenced using array notation
viz: myArray['someName'+i]
My question is ... can mcs that have been placed on the stage and given instance names be referenced in some similar way? If I have placed 10 mc's with different instance names eg mg1, mg2, mg3 etc, can I reference them using array referencing?

View 6 Replies

ActionScript 2.0 :: Looping, Then Referencing Dynamic Clips From Array?

Jan 4, 2006

i'm looping thru xml nodes and using this to attach clips to an empty mc:Code:item = _root.mainHolder.links.linkHolder.attachMovie("linkClip", "linkClip" + i, i);my question is how can I reference the previously attached clip so I can determine the _y property of the current item(clip).I'd like to do something like this.item._y= previously attached clip._y-previously attached clip.height

View 10 Replies







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