Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Make A New Var Name From An Instance Name?



Hi everyone

Would it be possible to make a new variable out of an instance name?
I have five instancenames and at one time I want them all to listen to one new name that I use in as.

In coldfusion it would be something like:
<cfset instance_name=newvariablename>



FlashKit > Flash Help > Flash ActionScript
Posted on: 04-09-2004, 12:57 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

How To Make Two Actions On One Instance?
When button is pressed i need to play a movie clip for 7 further frames, and then go to other frame within that clip and start playing from there.

Make A Variable From An Instance Name?
Is it possible to grab an instance name and turn it into a variable? I was thinking something having to do with Get Property?

Thanks!

Make Instance From Movie On The Fly
hi

i want to make instance from movie clip stored in my library
when i press button and give it values
help please

Make Instance Play Once?
I created a new symbol (animated text graphic) and have dragged it from the library to the stage, but once it's on the stage it's looping until the end of the movie. In previous versions of Flash I recall telling the clip to play once in the Modify>Instance area? What do you do in MX?

Thanks!
Dave

How Can Make An Mc Instance Name In A Variable ?
Example:

var MyInstance = "instanceX";

_root.MyInstance.gotoAndStop(3); // That not working

Thanks

How To Make An Instance Pause?
Hello all,

I'm still trying to learn how to navigate from start to end within a frame. Lol, I'm trying something new, I'm calling a function that checks for a level status, and does a while (notend of game condition) and creates the right levels.


ActionScript Code:
public function startGame() {
    var gameNotOver:Boolean = true;
    var level1:Boolean = true;

    while (gameNotOver) {
        if (level1) {
            var first:Level = new Level();
            addChild (first);
            first.startLevel();
                   
            level1 = false;
        } else if (!level1) {
            trace("level 2 playing");
            gameNotOver = false;
        }
    }
    trace("calling GameOver screen");
    gotoAndPlay("GameOver");
}//end startGame

Essentially once I add "addChild(first)" which plays an instance of the first level, the while loop here ends and it goes on to play level2, while the firstLevel is still executing. How do I make it understand to wait for the instance to be over or pause? I thought perhaps timer would work but it doesn't feel like a clean way to check (in the event the game is done sooner than the allotted time.) I've traced the steps and the while loop is finished way before the instanced first.Level is. :x I'm a little confused. Or maybe, this needs a Listener to be added? Hrmmm

Any help is appreciated.
-m

How To Make A Instance Delete It's Self
ok say i wanted to add a function to a class that made it delete its self, this code checks out to be ok, but doesn't work can somebody explain to me how i would do this


ActionScript Code:
class suicide {    function suicide() {        delete this;    }}

Can You Make A Movie Instance Go To A Specified Frame?
I have a movie instance that has code in it that will only work on a Movie instance but I need to be able to go to a specified frame when a user clicks on it like a Button instance. How do approach this to make it all work?

How To Make A Class Instance Self-delete.
I am making an oop particle effect system and I would like the particles (instances of the particle class) to self-delete after their life is up. How can I do this?

Edit: Nevermind, I figured it out.

How Do I Make Dynamic Instance Names?
In as3 i normally do:

var something:Customclass = new Customclass(params)
addchild(something)

Now i am asking how do i create/name "something" dynamically? Meaning, say use a loop to create, something_0, something_1,........something_9 etc!

Click One Instance, Make All Others Unclickable?
Hello,

I'm in the process of programming a strategy game and I'm looking for suggestions on how to approach an issue that I've discovered. Right now, the characters on the screen bring up a personal menu full of status info and game options (attack, magic, move) when you click them. The issue is with the "attack" command (or indeed any command with which you target another character on the screen). When you click on a character within your selected character's range of effect, you should select it as the target of your action but as it currently stands, clicking on your target just brings up *the target's* menu.

The game is designed with OOP, and all the characters are instances of a character Class definition. Their onRelease() behavior can be changed on an individual basis by clicking on them. My question though, is whether there is a slick way to dynamically change the onRelease behavior of all the characters on screen at once when you click "attack" or "magic" or something similar. I've heard of "subscribing" instances of a class to a listener of some sort, but I'm unclear on the concept and on whether it is what I'm looking for. Can anyone supply a little direction for me to look towards?

AddChild To Make A Global Instance?
From what I understand, in AS3 you use addChild in the place of attachMovieClip to make new instances of movie clips, but how do I make these new instances globally accessible? here's my code:


Code:
function shoot(event:MouseEvent) {
avatar_mc.gotoAndStop("shoot");
var bullet_mc:MovieClip = new bullet_link();
stage.addChild(bullet_mc);
bullet_mc.x = avatar_mc.x;
bullet_mc.y = avatar_mc.y;
}
That code is called every time you press the mouse. What I want it to do is continuously create more instances of bullet_mc as long as the mouse button is down, and then be able to access their .x and .y from another function which is called every frame, so that I can keep them moving. Right now the above code creates a single instance of bullet_mc, which I can't access from other functions, so it doesn't move at all.

Any help would be appreciated!

Can You Make A Movie Instance Go To A Specified Frame?
I have a movie instance that has code in it that will only work on a Movie instance but I need to be able to go to a specified frame when a user clicks on it like a Button instance. How do approach this to make it all work?

Can You Make A Movie Instance Go To A Specified Frame?
I have a movie instance that has code in it that will only work on a Movie instance but I need to be able to go to a specified frame when a user clicks on it like a Button instance. How do approach this to make it all work?

How To Make An Instance Move X Pixels In Y Seconds
Hey guys!

I'm creating a Flash program that simulates the Millikan Oil Drop experiments.
I need the oil drop to move on the Y axis a certain amount of pixels in a certain amount of time. A constant calculation will be taking place as the amount of pixels per. second will be dynamically effected by the user hitting keys (allready have that all programmed).

I'm not sure how to go about this

I just need the basic idea of how to make a Movie Clip instance move on an axis. So far everything I've done has moved it their instantly, and I dont want this to be dependent on the CPU speed of the users computer.

I've tried something like:
------------------------------------------
oil_drop1._x = 264;
oil_drop1._y = 130;

for (var i=130; i < ; i+=.05) {
oil_drop1._y += i;
}
------------------------------------------

But it does it instantly

I've also tried an incremented value in the form of:

setProperty(_root.oil_drop1, _y, oil_drop1 = 200)

but that doesnt work either, again because its dependent on the CPU clock speed.


Any help IS GREATLY APPRECIATED!!

Thanks guys! This is my first time posting!

Concatenate Variable To Make Instance Name Path?
I looked over a few other posts on this topic, but I haven't found any answers that I could get to work. In AS 2.0, I would create lots of movie clips, text fields, etc, that had sequentially numbered instance names. Then, when I wanted to modify all or some of them, all I had to do was something like this:


Code:
for (i=0; i < 10; i++) {this["myTextField"+i].text = arrayOfText[i];}


(Or I could use _root instead of this, if the text field was at the root level.)

Now in 3.0, nothing I try works. All my attempts to use the square-bracket syntax in the path to the text field generate errors, creating a temp. holder variable to hold the name of the text field instance doesn't work...it's really frustrating. Surely there has to be a simple way in AS 3.0 to write a path in which the instance name you're targeting is provided by concatenating a string and a loop's iteration variable, right?

[easy] How To Make A Right-click Menu Instance?
ActionScript Code:
// CustomMenu.aspackage com.website.utils{        import flash.display.Sprite;    import flash.events.ContextMenuEvent;    import flash.ui.ContextMenu;    import flash.ui.ContextMenuItem;    import flash.events.*;        public class CustomMenu extends Sprite    {                private var menuItem1:String = "dsfdsfsfd";                public function CustomMenu():void {            var stageMenu:ContextMenu = new ContextMenu;            stageMenu.hideBuiltInItems();            var item1:ContextMenuItem = new ContextMenuItem(menuItem1);            item1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, itemChosen);            stageMenu.customItems.push(item1);              this.contextMenu = stageMenu;           }        private function itemChosen(event:ContextMenuEvent):void {                    }            }    }
and...

ActionScript Code:
// DocumentClass.aspackage {    import flash.display.MovieClip;    import com.website.utils.CustomMenu;        public class  DocumentClass extends MovieClip    {        public function DocumentClass():void {                        var rightClickMenu:CustomMenu = new CustomMenu();                    }    }    }
Why isnt this working? Just trying to use that CustomMenu class I built to make the movie have a right-click menu.

Instance Names...changing...or Addressing Txt Field Instance Based On Instance Of Mc
i'm creating a mail form, that has a text effect which displays the type of info to be entered in each input box. To create this effect, i had to assign the variable name txt to the input boxes as well as the instance name txtBox. each of these text fields is contained within a movieclip, each with a unique instance name. what i need to do, is somehow assign a value/variable to each text field to pass to PHP to generate an email. I have always used components for contact forms so i'm not sure how to make the switch, AND.. the script i use for my contact form is an EXTERNAL AS file. (i use a customized version of a contact form from www.actionscript-toolbox.com [which apparently is no longer Flash related site])

ok.. this is hard to explain..... so bear with me....
If my original mail form component instance names were: tiName, tiEmail, tiSubject and taMsg (ti for textInput and ta for textArea)
and my current instance names for the mc's which CONTAIN the input boxes (with txtBox textfield instance inside them) are: name_txt, email_txt, subject_txt & comments_txt...

how would i pass/convert the users input text in each movieclip's txtBox, into the original instance name for my mail form so i can continue to use the form/PHP i have been using??

OR....

how do i take the values input by the user in each txtBox (i.e name_txt.txtBox.insertedTextFromUser or name_txt.txt, email_txt.txtBox.insertedTextFromUser or email_txt.txt) and send them to a new PHP script to send mail??

please keep in mind i am PHP retarded... hence why i re-use the same form over and over..

thanks in advance for any help. it's greatly appreciated...

if you're confused about my problem, please let me know... i'm having a difficult time explaining....

Tween Class Problem: How To Make One Instance Independent From Another
I was working on a Flash 8 work using the Tween Class with the help from the Kirupa and gotoAndLearn() tutorials.

Here's the actionscript code:


Quote:




import mx.transitions.Tween;
import mx.transitions.easing.*;
import flash.filters.GlowFilter;

//creates Glow Filter
var gf:GlowFilter = new GlowFilter(0x16004D, 100, 1, 1, 1, 3, false, false);

//assigns Glow Filter and its "first look" properties to the object
var gfX:Tween = new Tween(gf, "blurX", Elastic.easeOut, 5, 5, 1, true);
var gfY:Tween = new Tween(gf, "blurY", Elastic.easeOut, 5, 5, 1, true);
var gfS:Tween = new Tween(gf, "strength", Elastic.easeOut, 1, 1, 1, true);
var gfC:Color = new Color(text1);

//================================================== =====================

//Object 1
text1.onRollOver = changeOver;
text1.onRollOut = changeOut;
motionChanged(text1);

//Object 2
text2.onRollOver = changeOver;
text2.onRollOut = changeOut;
motionChanged(text2);


//=================================================

function changeOver()
{
gfX.continueTo(40, 2);
gfY.continueTo(40, 2);
gfS.continueTo(3, 2);
gfC.setRGB(0xC7CEC1);
}

//------------------------------------------------

function changeOut()
{
gfX.continueTo(5, 2);
gfY.continueTo(5, 2);
gfS.continueTo(1, 2);
gfC.setRGB(0x000000);
}

//------------------------------------------------

function motionChanged (textClip)
{
gfX.onMotionChanged = function()
{
textClip.filters = [gf];
}
}




Now, my problem is that when I move my mouse over one of the object, the other object also reacts. Say I roll my mouse over text2, text1 reacts as if the object too has a mouse over it. Another problem is that only text2 is showing the tween class.

I want these two instances to be independent from each other while at the same time not having to create actionscripts that is exclusively dedicated to each instances (if possible). I want to make sure that if I have the mouse over one of the instance, it will be the only instance to react.

Thanks.

Memory Leak/Does Flash Make Another Instance Everytime It Pa
I've got a Flash project about 100 frames long. The movie gets the filename of a jpg, then displays it as Flash makes it slowly drift by....but there's a memory leak. Everytime it loads another jpg, it adds about 1mb or so of memory, and that quickly adds up. I was reading another post ([url="http://www.actionscript.org/forums/showthread.php3?t=156554"]http://www.actionscript.org/forums/showthread.php3?t=156554[/url]) and Witchunter was having the same problem, he seemed to fix it by referencing the same variable. I thought my code was doing that already. Do I have to use .dispose()? Does Flash create another instance everytime the movie goes back to frame 1? Is it because I'm using "new Bitmap()"?

...Any solutions?


This is the code on my first frame.
Code:

import flash.filters.GlowFilter;
import flash.filters.BlurFilter;
import flash.events.Event;
import flash.external.ExternalInterface;
import ascb.util.NumberUtilities;

/*********************************
Variables
*********************************/
var border1:GlowFilter = new GlowFilter(0xEEEECC, 1, 5, 5, 10, 3, false, false);
var border2:GlowFilter = new GlowFilter(0xEEEECC, 1, 5, 5, 10, 3, true, false);
var blur:BlurFilter = new BlurFilter(64, 64, 2);
var fxArray:Array = [border1, border2, blur];
var image:Bitmap;
var xInt:Number;
var yInt:Number;

var url:String;
var request:URLRequest;
var loader:Loader = new Loader;


/*****************************
Body
*****************************/
//stop 1st frame and load picture...then gotoandplay (2)
stop();
getPhoto();

function getPhoto():void {
   url = "images/photos/" + ExternalInterface.call("getRandPhoto");
   request = new URLRequest(url);
   loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
   loader.load(request);
}

function imageLoaded(event:Event):void {
//load and init image: alpha=0, autoSize
   var ratio:Number;
   
//create image instance and initalize blurry and translucent   
   image = new Bitmap(event.target.content.bitmapData, "auto", true);
   image.alpha = 0.5;
   image.filters = fxArray;

//resize image, no side is bigger than 220 pixels
   if (image.width > 220) {
      ratio = 220 / image.width;
      image.width = ratio * image.width;
      image.height = ratio * image.height;
   }
   if (image.height > 220) {
      ratio = 220 / image.height;
      image.width = ratio * image.width;
      image.height = ratio * image.height;
   }
   
//randomly place image
   image.x = NumberUtilities.random(-20, (380 - image.width));
   image.y = NumberUtilities.random(-20, (255 - image.height));
   
//randomoze velocities
   xInt = (Math.random() * 0.3);
   yInt = (Math.random() * 0.3);
   
//calculate direction
   if (image.x > (360 - (image.x + image.width))) {
      xInt *= -1;
   }
   if (image.y > (235 - (image.y + image.height))) {
      yInt *= -1;
   }
   
   addEventListener(Event.ENTER_FRAME, onFadeIn);
   
//display image and go
   addChild(image);
   gotoAndPlay(2);
}

Beginner, Button._alpha = 100 And Identifying 'instance Of And Instance Name' Problem
1)
as Flash beginner
i'd like to have a button contain the feat. alpha = 30.
The following is for MC only:
onClipEvent (load) {
_alpha = 0;
}

What is the onClipEvent part for buttons.

2)
When to use 'instance of' and 'instance name'?, and how to identify them in an AS code such as:
_root.button._alpha = 100;

Access Property/function Of Instance From Inside Another Instance
Might be something really obvious, but I'm still trying to get my head round as3...

I need to call up a property and function of another instance of the same class, similar as in as2 (called from within "_root.instance_mc1"):

ActionScript Code:
_root.instance_mc2.someNumber = 0;
_root.instance_mc2.someFunction();

Now in AS3 I can access the object (extending sprite) itself (and inherited properties like x) by using:


ActionScript Code:
this.parent.getChildByName("row2").x

but if i try to access public variables/functions from that object (this.parent.getChildByName("row2").someNumber) I get Error 1119: Access of possibly undefined property someNumber through a reference with static type flash.displayisplayObject.

Anyone know how I can get this to work?

Code In One Instance Is Referencing The Previous Instance
I have the following code in a button symbol:

on (release) {
gotoAndStop (2);
_root["answer" + this._name.substr(1)] = "true";
}

I also have an instance of the button in 2 consecutive keyframes. The first instance is named "Q5" and the second instance is "Q6".

I expected the code: this._name.substr(1)]
to reference "5" and "6" from the instance names (Q5 and Q6), but instead instance "Q6" is referencing "Q5"!

The *really* strange thing, is that when I insert a blank keyframe between the two original keyframes, the code works perfectly!

Does anyone know what's happening?

[MX04] Get Instance Name Of Rolled Over Array Instance
Hi
I am willing to do a rollover image gallery which enlarges image on rollover event and shifts the neighbouring ones aside..

Here is the code so far

Code:
_root.bttn.onRelease = function() {
createGallery();
};
function createGallery() {
var row11:Array = new Array("DSCF5659", "DSCF5807q", "DSCF5773q");
for (i in row11) {
_root.createEmptyMovieClip(row11[i], _root.getNextHighestDepth());
_root[row11[i]].loadMovie("segi/"+row11[i]+"small.jpg", [row11[i]]);
_root[row11[i]]._x = i*150;
}
}
_root.onEnterFrame = function() {
function roll() {

var row11:Array = new Array("DSCF5659", "DSCF5807q", "DSCF5773q");
for (i;i<row11.length;i++) {
_root[row11[i]].onRollOver = function() {

this._xscale += 10;
};
}
}
roll();
};
What I would like to do is to:
ask flash which particular movieclip was rolled over , what is its instance name and than perform string operation to get a number (order) of that clip (I am naming all dynamically with image name + number in order)

Can anyone help me please ???

Thanx in advance

How Do I Copy A Sprite Instance Into A BitmapData Instance?
I apologize if this is covered elsewhere: I just don't even know what terms to search on to find what I'm looking for...

I have a sprite that receives various user-drawn lines on it during runtime. I would like to be able to copy this Sprite into a BitmapData instance, then send the pixels from the BitmapData instance to a PHP script. I think I'll be all right with the PHP end of things, but I just don't know how to copy my Sprite into a BitmapData.

(If there were a way to just use BitmapData and use the moveTo, lineTo, mouseX, mouseY, etc, methods, then I'd do that, but I don't even know if that's possible...Obviously, I'm not as well-versed in AS3 as I'd like to be.)

Thanks in advance for any help!

Instance On Top / Movie Instance Depth
Hi everyone,
I would like to know how, if possible, i can get the depth of a movie instance. Basically I just want to make the movie instance clicked on on top of all the others. I was going to try to do this using the swapdepths action but if anyone knows of a better way please tell me!
thanks a lot
jordan woolley

Returning The Instance Name Of A Class From Within The Instance
Hi,
I'm trying to do some error reporting in my actionscript.
I have a class MyData which can be instantiated several times over in each project e.g.
var myData1:MyData = new MyData();
var myData2:MyData = new MyData();

In the error reporting I have put statements like
trace("MyData.loadData reports error.... message...");

However, I'd really like it to return the instantiated name, not the generic class name so that I can trace errors to the particular instance that is failing. Does anyone know how to do this? I've tried
trace(this.toString() + " reports error.... message...");
but I just get a name of [object object] which isn't that helpful!

Many thanks!

Removing Instance X Inside Instance X
In Flash CS3 in library I have a MovieClip symbol Help (exported for AS).
The function below opens an instance of the symbol when the button is clicked.


ActionScript Code:
function showHelp(e:MouseEvent):void {
    var helpwindow:Help = new Help();
    helpwindow.x = 50;
    helpwindow.y = 50;
    addChild(helpwindow);
}
This works and instance "helpwindow" shows on the screen.
Now inside the symbol Help i have another button which will run a function that would close that instance. How do I get rid of that instance? I was trying with removeChild but errors occurr.


ActionScript Code:
function removeHelp(e:MouseEvent):void {
    removeChild(MovieClip(parent).helpwindow);
}

Quote:




TypeError: Error #2007: Parameter child must be non-null.

How To Call The Instance Name Inside That Instance?
Ok this is what I want...

I am inside an instance of a movie clip. And I want to access the properties of this movie clip. Now the problem is (if) I don't know the name of the instance of the movie clip (suppose I create the instance of the movie clip on the fly!!!), how do i refer to the name of the instance.
Is there something called this. in actionscript?

Any help would be appriciated!!!

Sushubh

Dynamic Instance Name Vs Manual Instance Name?
Hello,

I would like to access this object (taken from Debug > List Objects of in flash player)


ActionScript Code:
Target="_level0.promotion0.loader_mc.instance87.promo TXT"




This is what I am trying to access it with:


ActionScript Code:
trace( this.getChildByName("promotion0").loader_mc.getChildByName("instance87").promoTXT.text );





Error:


ActionScript Code:
1119: Access of possibly undefined property loader_mc through a reference with static type flash.displayisplayObject.






what is the correct way to do this?

How To Get Button's Instance Name On Stage? OR Can A Button Ahve 2 Instance Names?
i have a button the the stage, with an instance name of: "butt1"

the button itself lives inside a movieclip, where it is called thisButton

when flash runs and I click the button I want to output the button's instance name on the stage (i.e. butt1) but i'm only getting the button's instance name in it's own movie

this._name gives me = thisButton

is the name i want stored in a separate property?

edit: sorry - i realise that the problem is that the button code is inside the mc itself, where the button's name is thisButton

Instance Name Instead Of Instance Number
hey there,

the following code returns strange names for the instance: I get 'instance61' and 'instance55' when clicking the button in the MC named 'tabber'. I would expect to see 'tab' and 'tab2'.

Is there a way to get the instance name instead of the instance number?

cheers!


PHP Code:



package {    import flash.display.MovieClip;    import flash.events.MouseEvent;    import flash.display.SimpleButton;        public class content extends MovieClip    {        public function content()        {            //content.stop();            var tab:tabber = new tabber();            tab.x=118; tab.y=75;            tab.butt.addEventListener(MouseEvent.CLICK, ms2);            addChildAt(tab,1);                        var tab2:tabber = new tabber();            tab2.x=228; tab2.y=75;            tab2.butt.addEventListener(MouseEvent.CLICK, ms2);            addChildAt(tab2,1);        }                function ms(event:MouseEvent):void         {            trace(event.target.parent.name);        }    }} 

Any Way To For A Class Instance To Ask What Its Instance Name Is?
Hey. I have a class which needs to create a movie clip on the stage. Since each instance of the class will only ever have 1 movie clip on the stage at a time, it seems reasonable that I have the instance create a movie clip with its own name, prefixed with "mc_" or something of the sort.

Here's where I don't know quite what to do... How do I get at this information? For instance, when you a dealing with an XMLNode, you can simply use...

the_answer = xmlNodeInstance.nodeName;

...I know the analogy fails, but hopefully you know what I'm looking for.

Thanks!

Calling An Instance Within An Instance
Hi,

I've got 3 movieclip buttons with instance name, "btn1", "btn2" and "btn3". Inside these clips is another movieclip named "mousedetect".

How do I use a loop on the "mousedetect" movieclip to initiate an action? Without a loop it will look like this:

btn1.mousedetect.onRelease=functiion(){
btnRelease();
}

I've tried something like:

for (i=1;i<=3;i++){
this["btn"+i].mousedetect.onRelease=function(){
btnRelease();
}
}

but an error shows up, what should be the correct syntax?

Thanks!

Want Opening Movie Clip Instance To Close Underlying Movie Clip Instance
Just so you all know, I'm one of three people in our company that uses Flash and I'm considered "the expert". However, we don't do more than a few Flash projects a year, so my scripting knowledge is very, very green. Thanks in advance for your patience.

I have 22 buttons that play an assigned movie clip from the library. I suspect I'm building these things the wrong way (probably true), but here is how each button is constructed....

Each instance that I'm calling a button is actually identified as a movie clip intance with a button in it. It sits on its own layer. When I double-click an instance, several layers are displayed, the majority of which belong to the presentation of the movie clip. The clip lasts five frames.

The first frame consists of blank keyframes for each layer except for one layer that has stop() assigned to the frame and another layer with the actual button. The layer with stop() at frame 1 is then blank for the next three frames, and then another stop() on frame 5 (the last frame).

The button layer lasts all five frames. Here's the script for "display1980":

on (rollOver) {
_root.display1981.gotoandstop(1);
_root.display1982.gotoandstop(1);
_root.display1983.gotoandstop(1);
.
.
.
_root.display2003.gotoandstop(1);
_root.display2004.gotoandstop(1);
_root.display2005.gotoandstop(1);}

on (release) {
_root.Play();
play();
}

For each instance, there is no line of script that refers to itself. In this example for display1980, "_root.display1980.gotoandstop(1);" is not used.

As I mentioned earlier, each instance is on the main stage on its own layer. I've done this with only eight of my instances, so there are now eight layers. (There are--in fact--more than eight layers, but those are not part of this issue.)

The script I created does the job of getting rid of any previously displayed movie clip, but I created a new conumdrum: If I rollover any other button, the currently displayed clip closes. I've tried replacing "on (rollOver)" with "on (press)" but that doesn't work.

Like I said, I suspect I'm buildng this wrong. Is what I built a waste of time, or can it be salvaged? Or, is there a much better and efficient way (and I suppose there is) that can be described so that my green experience can absorb to good effect?

Accessing Movieclip Instance Within Another Movieclip Instance
Accessing library movieclip instance within another library movieclip instance issues.

I have a movieclip in the Library called menuBar. In the menuBar mc I added two buttons. I want to be able to click on each button to play a video for each corresponding button. When I mouse over the button the pointer turns into the hand, suggesting it recognizes it as a button. But I'm unable to access the button (menuBar.button1 in AS2) in my code, I'm using AS3. Any help would be much appreciated. Thank you for your time.

Trying To Make A Formula To Make My Stickman's Head Adjust To The Direction He Moves
Ok, im making a little "walk around" movie clip...

you click he moves...

heres my .fla for the 2nd (main) question
My .Fla

I have 2 questions

the simple one first

Question 1 how do I flip an image, in the Graphic interface of flash pro 8, you can go to modify - transform, and flip it CCW + 90, CW + 90, or flip it horizontally or vertically, how can I do this in actionscript? my animation's name is "man"


Main Question

How do I write a formula to adjust my guys head so when he goes "left" or right, his head is thinner, (like your looking on him sideways)

and when he goes up/down, to be bigger so basically

when he's going up and down his head width is about 20-30, and when he's going left/right, its about 5-10

I've been trying for about 1 and a half hours, with no success

all my code:


Code:
var TargetX:Number = 200;
var TargetY:Number = 150;
var man_height:Number = man._height;
var man_width:Number = man._width;
var head_width:Number = man.head._width;
var head_height:Number = man.head._height;
var head_x:Number = man.head._x;

function clicked_spot()
{
TargetX = _xmouse-man_width;
TargetY = _ymouse-man_height;
}

function move_man()
{
man.head._width = 10;
//man.head._x = 20

if (TargetX > man._x-20)
{
man._x += 1;
}
else if(TargetX < man._x-20)
{
man._x -= 1;
}
if (TargetY > man._y-5)
{
man._y += 1;
}
else if(TargetY < man._y-5)
{
man._y -= 1;
}
}
setInterval(move_man, 10);
ground.onRelease = clicked_spot;
thanks in advance

How Can I Make A Startdrag And Stopdrag Actioned Mc Make A Sound?
HI there,

I need help on this one. I have used the start and stop drag AC for pulling a sword in and out of its sheath(holster). Thats all it has to do. One problem is that no matter how hard i try i can get the sounds to match up with it. I wanted for the sounds to play everytime the user puts the sword in and everytime the user takes the sword out. how can I do this?
Thanks alot

~Joe

How To Make Flash Make Html Page Return To Top?
Hey guys,
I created a website which contains a verticaly large flash movie on it which displays information. In order to read the bottom half of info, the user must scroll down the page. I was wondering if anyone knows the code to make a "return to top" button in flash which would send the html page back to the top without reloading the actual page itself of corse. I just cant figure out how to do it. Thans!

How Can I Make Obstacles And How To Make Something Jump When Pressing Space
hey im trying to make a flash game but how do you make obstacles that you mite hav to jump over of somthin cos i tried but things just go straight through it. also, how can i make somthing so it jumps wen you press space?
plz help!

How To Make A Movie Clip Button I.e. Make It Click-able
i followed the tutorial for making animated buttons by using movie clips instead of button symbols. now i don't know how to make them click-able. this is probably pretty basic, but i'm new to flash and i'm getting pretty frustrated trying figure things out by myself (no programming experience here, although i did buy the flash bible). i'm using flash mx 2004.

any pointers on how to do this would awesome. thanx a ton.

--V

How Do I Make Buttons That Just Make A Movie Carry On?
I am trying to figure out either how to make a movie end, instead of keep going around, and around again in a loop. Or, I need to know how to get a replay button.

Thanks Please help.

--LONDONABOY--

How To Make A Condition Only Make Action Take Place After It's Done Twice
How do i make this only happen when it's done twice

if (Math.sqrt(xdist*xdist+ydist*ydist)<ob.width+obene my.width) {
obenemy.clip.removeMovieClip();

I Wanna Make Intro N Dnt Kno How Ta Make In Flash
Hello every 1
i wish sum1 can help mi !!!
i m makin my site n i wanna make a intro n i got Macromedia Flash PRo 8 but i rely dont much abt it....
intro iz lyk whn sum 1 open de page c dat animation .....bla bla ...... can sum1 plz help
n ask mi if they dnt get mi
my contact mail: nasty_thinker@hotmail.com

Make Favorites And Make Homepage Script
Hi guys.. can anyone post a make favorite and make homepage actionscript here?? pleaseeeeeeeee

thx

Make MC Visible, Make MC Invisible
Looking for a piece of script to (on rollover of other MC) make a MC placed on the stage visible, then to make it invisible.

I think there is a simple piece of code to target the MC and tell it visible == true or false???


Any Help greatly appreciated,

Thank you kindly,
cpalino

Is It Possible To Make A Website For Some1 So They Can Make Changes Themselves?
I was wondering if i can make a website for some1. for example, if i made a website for photographer, how can i make so that he can do changes in the galleries, by himself? Is there a tutorial or can someone explain to me how this could be done? thanx.

Getting An Instance Name
hello folks,
i am working on a flash site that duplicates a movie clip and gives it a name according to the original movie clip plus the loop . i.e original clip square, new name square1, square2 etc.
these are all draggable, and it all works ok, but i need to know when being dragged which of the clips is being dragged, i.e. i need to get its instance name.

ideally i want to be able to do something like:
onPress(
moviename=Getinstance name;
)
clearly getinstance name isnt possible but you get the picture..

thanks in advance

bob splendid

http://www.sensoriumdesign.net/

About Instance Name.
Dear all,
Can I name a instance name by running a PHP file?
That means the instance name is named by the PHP file.

Copyright © 2005-08 www.BigResource.com, All rights reserved