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








Movieclip - Button - Location On Stage


Fellow Gurus!

I am using Flash 8.

I rendered some boxes on the stage. One is for a menu and another is for graphics. The idea is to have a picture pop-up in the graphic box whenever one passes a mouse over a button in the menu (which is in the menu box).

I have added movie clips to each button’s mouse-over. The movie clips contain a picture (at least for now). Thus when you pass a mouse over the button, a picture pops up. That is the easy part.

Now, I could simply reposition the movie clip until it appears within the graphic box. My problem is – I have a bunch of buttons and they may or may not be placed in the menu in exact positions. If I were to change a button’s position, the movie clip’s position is relative to the button and not the stage thus it would have to be repositioned as well.

Therefore, the pop-up pictures within the movie clips which are within the buttons must all pop-up in the graphic box regardless of where I place or reposition the buttons.

Let’s say I have the graphic box located at x=500 and y = 120.
Let’s say the button’s name is First_btn.
Let’s say the movie clip’s name is OneTest_mc.
And, I can bring it on stage in order to add an instance name of perhaps TestOne.

Now, I have looked at localToGlobal and globalToLocal. I am not sure which one work for my situation.

I am assuming that I can add AS2 to the movie clip’s (OneTest_mc) timeline – if that is not where it goes - let me know.

I have looked at the various scripts on the Internet and all they do is confuse me, namely because they are rotating graphics, etc. In another words, they complicate the examples. What I need is a script to add to each button/movie clip to make them all place the pop-up graphic in the box regardless of where the button is located.

However, I do not just want a piece of script. I would appreciate some explanation of the code so I can learn from it – not just giving me a fish but teaching me how to fish.

Thanks in advance,

Bill




Adobe > ActionScript 1 and 2
Posted on: 07/16/2008 07:32:00 AM


View Complete Forum Thread with Replies

Sponsored Links:

Nested MovieClip Location Relative To Stage
Hi All,

I have the need to calculate the x,y location of nested movieClips relative to the stage. For example, lets say ...

clipA is at 100, 100
clipB is nexted within clipB a and its x,y within clipA is 200,200

So visually clipB appears to be at 200,200 but when I trace ..

trace("clip a.b " + a.b._x +" "+ a.b._y);

I get ... clip a.b x,y >> 156 156

I need to find out clipB's x,y relative to the stage at 0,0.

Any ideas?

I could do the math on the width and height of each movieClip but what if I have multiple nestings? Me thinks there must be an easier way.

TIA,
RandyS

View Replies !    View Related
Loading A Movieclip On The Main Stage From A Button Within A Movieclip - Big Headache
Hi there,

i am trying to put together a portfolio site, which uses a 'floating' panel with buttons on it. In order for it to move around it has to be a movieclip. So all the buttons are stored within a single movieclip, which is giving me a headache because i want those buttons to load other movieclips from my library onto the main stage (as like a popup window within the flash)

Its all slightly confusing. i have tried using this code based within the movieclip where my button is based:

button_play.buttonMode = true;
button_play.addEventListener(MouseEvent.CLICK, OpenBox);
function OpenBox (e:MouseEvent):void{
this.addChild(new mc_box());
}


button play is within a movieclip called mcTweenMe2 (which is on the main timeline) and i want the movieclip to be loaded on the main timeline (not within in the movieclip where the button 'button_play' is based) mc_box is the movieclip i wish to load on the main timeline (in the centre) with the ability to close it also!

Bit of a headache, please help me someone i have run out of sites to look for answers!

PS: does anyone know why stop (); wont stop my timeline playing like it used to in AS2? beacause another option for making my site work is making this button target labeled frames in the main timeline, however stop (); don't seem to work now!

Thanks!

View Replies !    View Related
Remove A Movieclip Off The Stage When I Click A Button.
I dragged a movieclip onto the stage, gave it an instance name but want to know how to remove it when I click a button.


Code:
Startup.visible = false;
??

View Replies !    View Related
AS3 Stage Location
I downloaded an image viewer from Flashden and I'm having issues getting it centered on my site. I'm new to AS and fairly new to flash so any help would be great!! The code seems pretty complex and its a separate .as file. I've looked all throughout the code, but can't seem to find any place to tell it to place the image gallery in the center.

The site is www.emliss.com/gallery.html

I've attached the .as file

Thanks

View Replies !    View Related
Attaching A Movieclip At A Specific Location Inside Another Movieclip
Hello all,

I am trying to attach a movieclip(a) inside another movieclip(b). When (a) is attached it is always attached at the top left corner OR if I use getNextHighestDepth() then the movieclip (a) is attached randomly at different locations. I would like (a) to be attached at the centre of the parent movieclip or at a specific location inside parent movieclip.

Please help me with this. Me a newbie to actionscripting.

Thanks,

Nish

View Replies !    View Related
Movieclip As Button Loses Its Action When Given An Instance Name On Main Stage
I've created moveclip buttons that "pulsate" (light effect) upon mouseover. When I place them on stage, they work fine (pulsate during a mouseover).

However, once I give the movieclip/button an instance name on the main stage (to call a LoadMovie onPress), they lose their pulsate/movieclip action. They do however, fuction correctly in loading the specified movie - they just lose the mouseover action.

Here is an example of the code for the movieclip/button on the main stage:

(services is the movieclip/button instance name)
--------------------------------------------------
services.onPress = function() {
_root.createEmptyMovieClip("container", 1);
loadMovie("services.swf", "container");
container._x = 200;
container._y = 30;
};

---------------------------------------------------

The movieclip/button itself has the following code (which again, works fine on the main stage until an instance name is applied to it).

---------------------------------------------------
ACTION WITHIN FRAME ONE: stop();

ACTION WITHIN THE BUTTON GRAPHIC:

on (rollOver) {
gotoAndPlay(2);
}
on (rollOut) {
gotoAndPlay(1);
}
---------------------------------------------------


I've been searching, but can't seem to find what I'm looking for. Any thoughts? Feedback is greatly appreciated. Thanks in advance!

View Replies !    View Related
Movieclip As Button Loses Its Action When Given An Instance Name On Main Stage
I've created moveclip buttons that "pulsate" (light effect) upon mouseover. When I place them on stage, they work fine (pulsate during a mouseover).

However, once I give the movieclip/button an instance name on the main stage (to call a LoadMovie onPress), they lose their pulsate/movieclip action. They do however, fuction correctly in loading the specified movie - they just lose the mouseover action.

Here is an example of the code for the movieclip/button on the main stage:

(services is the movieclip/button instance name)
--------------------------------------------------
services.onPress = function() {
_root.createEmptyMovieClip("container", 1);
loadMovie("services.swf", "container");
container._x = 200;
container._y = 30;
};

---------------------------------------------------

The 'movieclip as button' itself has the following code (which again, works fine on the main stage until an instance name is applied to it).

---------------------------------------------------
ACTION WITHIN FRAME ONE: stop();

ACTION WITHIN THE BUTTON GRAPHIC:

on (rollOver) {
gotoAndPlay(2);
}
on (rollOut) {
gotoAndPlay(1);
}
---------------------------------------------------


I've been searching, but can't seem to find what I'm looking for. Any thoughts? Feedback is greatly appreciated. Thanks in advance!

View Replies !    View Related
Movie Location On The Stage
Hi;
Can someone help me out? I am trying to load a movie into a flash document in a certain location. The defaul location overlaps my title and I would like to have it lower in the stage.

Thank you very much
Riyad

View Replies !    View Related
Location Of Swf On The Stage When Using Loadmovie
sup fellas,

im working on this website over here, im perhaps an advanced newbie. Anyway this is the first time I am going to attempt to use "loadmovie". I got the whole concept on how to do it. My only problem is the location that the external swf appears.

For example;
say i have a box on the stage (this is my level 0), i want an swf with image.swf to be called upon. It will load on top of the current swf (level 1). The code is great everything works, only problem is that the box and the img.swf are no where near eachother.
Is there anyway to make that img.swf appear directly above the box?
Can i decide on the postion that i want all of the "loadmovie" levels (swf's) to appear?

I ask cause on alot of websites on the net i see different things loading all over. Webagent007.con for example, it has like 10 things loading in different postions.

thanks

View Replies !    View Related
Bringing An Object To The Stage At A Set Location?
Hey;

I need for flash to put an object from the library at a set location when another object (which is falling) hits the ground. Basically I need to know if there is a way to bring an object in, at a certain place from a command line placed in another object in actionscript.???

View Replies !    View Related
Obtain Nested MC's Location On Stage
Hi All -

I'm trying to get the X/Y stage location of a nested movie clip. However, all I can seem to obtain is the X/Y location of the clip relative to it's parent.

To clarify, let's say I have two movie clips, "MC_One" and "MC_Two."

MC_One - located on the main stage at position 50,50.
MC_Two - inside of MC_One, and located at position 10,10 (relative to MC_One).

In the Frame I have:

trace(_root.MC_One.MC_Two._x)

// this gives me "10" but what I really want is "60"

Is there a way to get MC_Two's position on the stage?

I'm guessing I am not referencing MC_Two correctly, maybe with "_parent" or something ? ? Any ideas?

ETA: I've added a sample file

Thanks -
Pete

View Replies !    View Related
GotoAndStop Depending On Location Of Mc On Stage
I used swift 3d to create a spaceship for use in flash. I decided to make a game where you fly through space from the veiw point of behind your ship. I have 9 positions of the spaceship. Ex: directly behind, behind slightly turned left, etc. for the different locations on the screen so it has a mock 3D movement. Now my question is how to designate a certain area of the stage as a place where the "SpaceShip" movieclip GoesToAndStops at the frame that would make it look like it rotated correctly. So basically I need to divide the stage up into 9 equal areas and when the spaceship enters an area it goes to a certian frame. How would i do this?

thanks

View Replies !    View Related
Load Mc Into Random Stage Location
Hello,

I want to load a movie clip into a random location on a stage that is 1024 x 768... yes a screen saver... but I am not sure how to go about specifying random stage placement..... Can anyone help me out?

Thanks ahead of time for your help... JK

View Replies !    View Related
Load Mc Into Random Stage Location
Hello,

I want to load a movie clip into a random location on a stage that is 1024 x 768... yes a screen saver... but I am not sure how to go about specifying random stage placement..... Can anyone help me out?

Thanks ahead of time for your help... JK

View Replies !    View Related
Load Mc Into Random Stage Location
Hello,

I want to load a movie clip into a random location on a stage that is 1024 x 768... yes a screen saver... but I am not sure how to go about specifying random stage placement..... Can anyone help me out?

Thanks ahead of time for your help... JK

View Replies !    View Related
Finding The Root _x Location Of An MC On Stage
Hello.
how do I find the _x value of a _mc relative to the stage? I have a movie clip buried 4 or five levels deep and if I get its _x value that gives its value relative to the movie clip its in. I need its actual position on stage.

thanks

View Replies !    View Related
Send An Object To A Specific Location On Main Stage?
im still pretty new to the terminology for this program, so my attempts to search for this topic have been unsuccessful.

I have a movie clip within another movie clip and I want one of the objects in the embedded movie clip to end at a particular spot on the main stage. Is this possible?

thank you so much in advance.

View Replies !    View Related
AS2 MovieClip Location In Parent MovieClip
Hi,

I'm trying to create a sliding background using images converted to movieclips.

I have created a movieClip:
imageLoader (which includes)
image1_mc
image2_mc
image3_mc

image1_mc is the beginning image on the stage. When I click on image2_btn I'm trying to get it to have
image2_mc push image1_mc off the left side of the movie. same for image3_btn would push image2_mc
off the movie.

Here's the kicker. When image1_mc is on screen and I click image3_btn I want it to push image1_mc off the left
side of the movie.

what is the best way to do this? do you know of a tutorial I can't find that shows how to do this?

thanks,
sky

View Replies !    View Related
Movieclip's Location
Hi all,
I would like to ask how i can get a x position of an object which reside in a movie clip to a global x position

View Replies !    View Related
MovieClip Location (x And Y)
Yo guys and gals, im trying to load a movie clip from the libary and get it to match the x and y coordinates of the move of which it is called from. I.e roll over Home movieclip and then this movieclip appears over the home movie instance.

Here is my code:

on (rollOver) {
targetX = Home._x;
targetY = Home._y;
_root.attachMovie("Button_Effect",BeClip1,0);
BeClip._x = targetX;
BeClip._y = targetY;
}

thanks in advance legion.
p.s sorry if it is a stupid question lol.

View Replies !    View Related
MovieClip Location (x And Y)
Yo guys and gals, im trying to load a movie clip from the libary and get it to match the x and y coordinates of the move of which it is called from. I.e roll over Home movieclip and then this movieclip appears over the home movie instance.

Here is my code:

on (rollOver) {
targetX = Home._x;
targetY = Home._y;
_root.attachMovie("Button_Effect",BeClip1,0);
BeClip._x = targetX;
BeClip._y = targetY;
}

thanks in advance legion.
p.s sorry if it is a stupid question lol.

View Replies !    View Related
Setting The Location Of A Movieclip
I've figured out how to load a movie to a level, but the problem is that it appears in the upper left corner. I've tried to use the _x property to place it where I want it to be but I can't figure out how to make that work. Can someone give me the syntax to use the _x and _y properties to place my movie? Do I have to go to expert mode to do what I'm describing here? I'm using flash 5.

Also if I want to have a single bitmap appear with a button click do I have to make it a .swf and use loadmovie? Or is there a simpler way to do that?

Thanks in advance.
[Edited by orgreeno on 10-28-2001 at 09:33 AM]

View Replies !    View Related
Run Another Movieclip In Another Location When Mouseover?
Hi everybody!
You know that effect, on DVD when you are in the chapter selection interface. You highlight eg. chapter 1 and above a frame with at picture starts moving and you see a little of that chapter. Sometimes with sound even. Is that possible in flash??? Well I know it ist cause Xiao Xiao from stick figures death theater uses that effect. It's supercool! You just hold the mouse over the picture and it starts moving. When you click it, it brings you to exactly that part of the movie and you can sit back and watch your favourite chapter. As I love animations and use flash primarily for that it would be a great help if anyone could figure this out or just knew how to do. It would really boost up my movies.

Pleeeeeasssse! Heeeelp meeeee!

View Replies !    View Related
Controlling A Movieclip From Another Location
to control a movieclip from another movieclip, is it:
on(whatever)
_root.movieclip.whatever();
}
and to control the timeline that ur in aswell as the other time line is it:

on(whatever){
gotoAndPlay()
_root.movieclip.whatever();
}

View Replies !    View Related
MovieClip _rotation Changes Location
When I draw my object ( in this case a triangle ) and then set the _rotation property, the movieclip moves the x to 0; Is there any way to preserve the x,y location of a movie clip after rotation?

i have attached an example. Please let me know. thanks.

View Replies !    View Related
F8 Movieclip Change On Stage Causes The Entire Stage To Dissapear
I have my stage with a background picture.

On stage left are buttons, and on stage right I have a movieclip (mc_Preview).

When the user puts his mouse over each button I would like the movieclip to move to a different frame.

the problem is when the mouse moves over a button, i see the movieclip move but then the entire stage dissappears and turns a few shades of gray.

Does this sound familiar to anyone?
Any help would be greatly appreciated!

View Replies !    View Related
Moving (teleporting) A Movieclip To A New Location.
Hmmm, it is late and I am pretty tired out right now. Do you guys know of a way to make it so when a movieclip (The moveable "character" in my side scroller) hittests another movieclip the character is moved (teleported) to a new location? Thanks guys, I really appreciate it.

View Replies !    View Related
Extends MovieClip - Location Error.
Whenever I try to access the _x and _y positions of my class that extends MovieClip I get diffrent results then they are... does anyone know whats going on???
Here is my code - red highlight is were problem is.

Code:
import mx.utils.Delegate;
import mx.events.EventDispatcher;
import mx.transitions.Tween;
import mx.transitions.easing.*;
class Duck extends MovieClip
{
private var talk:Boolean;
private var dName:String;
private var speed:Number;
private var i;
private var counter:Number;
private var parent:MovieClip;
private var home:MovieClip;
private var sComp:Boolean;

//mix-ins
private var dispatchEvent:Function
public var addEventListener:Function
public var removeEventListener:Function

public function Duck()
{
this.talk=false;
dName=this._name;
speed=90;
parent = this._parent;
home = this;
counter = 0;
i = null
sComp = false;
EventDispatcher.initialize(this);
}
function IsTalking():Boolean {return this.talk;}
public function MoveRelitive(x,y,time)
{
//_x and _y values dont correspond here.
var t:Tween = new Tween(this, "_x", Regular.easeOut, this._x, this._x + x,time,true);
var t2:Tween = new Tween(this, "_y", Regular.easeOut, this._y, this._y + y,time, true);
t2.onMotionFinished = Delegate.create(this, function() {this.dispatchEvent(new DuckEvent(DuckEvent.FINISHED_TALKING));});
}
function SayString(sText:String, sPrittyText:String, sound:String)
{
if(!this.talk)
{
var s:Sound = new Sound(this);
s.attachSound(sound);
s.start(0,1);
s.onSoundComplete = Delegate.create(this, function() {this.sComp = true;});
i = setInterval(Delegate.create(this,LipIt),speed,sText);
counter=0;
this.talk = true;
var narroration:String = dName + ":" + sPrittyText;
parent.N.narr.text = narroration;
}
}
function IsVowel(letter:String, letterN:String):Boolean
{
letter = letter.toLowerCase();
if(letter == "a" ||
letter == "i" ||
letter == "e" ||
letter == "o" ||
letter == "u" ||
letter == "y")
{
if(letter == "e" && letterN==" ") return false;
if(IsVowel(letterN," ")) return false;
else return true;
}
else return false;
}
function LipIt(sText:String)
{
if(counter < sText.length)
{
var letter:String = sText.charAt(counter);
if(IsVowel(letter, sText.charAt(counter+1)))
{
home["Lips"].gotoAndPlay(2);
home["Lips"].play();
}
counter++;
}
if(counter >= sText.length && sComp)
{
this.talk = false;
clearInterval(i);
sComp = false;
this.dispatchEvent(new DuckEvent(DuckEvent.FINISHED_TALKING));
}
if(sComp)
{
this.talk = false;
clearInterval(i);
sComp = false;
this.dispatchEvent(new DuckEvent(DuckEvent.FINISHED_TALKING));
}
}
public function SetMood(mood:String)
{
switch(mood)
{
case "Suprised":
{
this["Eye"]._yscale = 150;
}
break;
case "Angry":
{
this["Eye"]._yscale = 40;
}
break;
case "Normal":
{
this["Eye"]._yscale = 100;
}
}
}
}

View Replies !    View Related
Sequential Location For Attaching A Movieclip
Hi,

I am trying to attach a movieclip inside another movieclip.
I have read that they can be attached into the target movieclip at a random location or a particular location. (_x, _y).

How can I attach movieclips sorted (location wise) sequentially into the target movieclip?
I mean, first attached movieclip takes the top place in the movieclip and the second movieclip is attached just below the forst one?

I am a newbie and have no clue. Can someone show me a direction and help me please??

The target movieclip is a simple rectangle shape positioned vertically.

View Replies !    View Related
How To Stop Movieclip On Specific Location
Hi everyone,

I have attached mainmovie1.fla please check it and reply me.

there is down movieclip which i want to stop on specific location like up movieclip. up movieclip is working ok.

there is on marquee movieclip also want to work like marquee tag in HTML.

Please help me.

thanx in advance.

waiting for reply.

View Replies !    View Related
Dynamically Pulling Up MovieClip Location
Hey there,

I've got a question for you guys. Is there a way to dynamically pinpoint a movieclip location? For example, if I had a button tucked away in:


ActionScript Code:
_root.opening.menu.buttonClip1.myButton
... is there a way to pull up this location using an 'on(release)' ? Demonstration:

ActionScript Code:
onRelease() { _root.myVar = this._currentLocation;}// where 'this._currentLocation' = _root.opening.menu.buttonClip1.myButton  

Thanks,
William

View Replies !    View Related
Control MovieClip Via Mouse Location
Hi all - I am new to the forum, and have been searching for a tutorial to assist me in bulding something like Nike's skateboarder site - the animation of the riders section, check it out:
http://www.nike.com/nikeskateboarding/v2/main.html

Be sure to navigate to the RIDERS to view the animation - the mouse location changes the position of the rider.

How is this done? Is there a tutorial?

I created something using simple invisible buttons to control a MC,
http://www.brutalgiftland.com/gooshi.swf
but I know I need to write functions, vars, etc in actionscript to control a MC via mouse location!?
Correct?

Not too advanced - so please help if you can!?

thanks a bunch, M

View Replies !    View Related
Getting A Draging Movieclip's Previous Location
I'm wondering if there's an easy way to get the PREVIOUS x and y of a movieclip that's being dragged by the user. That is to say, the x and y the mc had before flash moved it with the mouse handler.

View Replies !    View Related
Dynamically Pulling Up MovieClip Location
Hey there,

I've got a question for you guys. Is there a way to dynamically pinpoint a movieclip location? For example, if I had a button tucked away in:


ActionScript Code:
_root.opening.menu.buttonClip1.myButton
... is there a way to pull up this location using an 'on(release)' ? Demonstration:

ActionScript Code:
onRelease() { _root.myVar = this._currentLocation;}// where 'this._currentLocation' = _root.opening.menu.buttonClip1.myButton  

Thanks,
William

View Replies !    View Related
Movieclip Load Location And Static Variables
Hi
When I use the "loadMovieClip" it actually loads the (0,0) point of the new movie, to the center of the clip... is there any way to go around it beside changing the movie itself and playing with the _x property?

and another question...
is there a way to keep a static variable for all the frames? right now Im using dynamic text and modify it. but I bet I just missed the right way to do it.

Thanks in advance,

Niva

View Replies !    View Related
? Resize Stage To Dynamically Match External Movieclip Loaded Into Empty Movieclip
Hi all,
Does anyone know how I can resize the stage to match the size of an external graphic/movieclip which is loaded into an empty movieclip,
thanks

View Replies !    View Related
? Resize Stage To Dynamically Match External Movieclip Loaded Into Empty Movieclip
Hi all,
Does anyone know how I can resize the stage to match the size of an external graphic/movieclip which is loaded into an empty movieclip,
thanks

View Replies !    View Related
? Resize Stage To Dynamically Match External Movieclip Loaded Into Empty Movieclip
Hi all,
Does anyone know how I can resize the stage to match the size of an external graphic/movieclip which is loaded into an empty movieclip,
thanks

View Replies !    View Related
Load Movieclip From Libary Into Another Blank Movieclip On Stage (URGENT PLEASE)
hi all i just need to know how to load a movieclip into a blank movie clip all in the same movie?! please help many regards peter thanks in advance!

View Replies !    View Related
Extend Class Movieclip And Movieclip Off Stage
Hi all,
Using Flash 8 and getting over to AS2.0 I got this problem. Could not find any answer on the forum until now.

I am trying to get some more grips on AS2.0 and do this by making a small game. On several frames are movieclips: mc1 mc2 etc. When the user clicks on them, the total number of clicks is recorded (among others) for each movieclip. On different frames are different movieclips.
I tried three ways.

1. First I defined a class MyMovieClipClass extends MovieClip with:
code:
private var clicks: Number
private function onPress: Void {
clicks++;
// do other things
}
public function howMuch: Number{ // return clicks }

Movieclips mc1, mc2, etc are defined being a member of this class in ‘linkage’.
The problem arose that when on a frame without mc1 I could not access mc1.howMuch() becase in that frame there is no mc1.


2. Then I defined two classes MyMovieClipClassA and MyMovieClipClassB
The movieclip on stage mc1 is a member of Class A and var clicks is in Class B.
The instance name of class B is derivated from the instance name on stage:
mc1 (ClassA) is kindof connected with mc1_obj (ClassB)
MyMovieClipClassA extends MovieClip with:
code:
private function onPress: Void {
// make instName = this._name + “obj”;
instName.clicks++;
// do other things
}


MyMovieClipClassB with:
code:
private var clicks: Number
public function howMuch: Number{ // return clicks }


In the timeline I then define:
code:
var item1: MyMovieClipClassA = new MyMovieClipClassA();
var item1_obj: MyMovieClipClassB = new MyMovieClipClassB();

which is not very elegant.
(the movieclip to which this belongs has the name item1)

3. I tried to declare ‘_name + “_obj”’ in de constructor of ClassA but did not succeed.

Anybody any suggestions for an elegant solution in which different movieclips in different frames on stage can be tracked using classes?
Thanks in advance for your reaction.

View Replies !    View Related
Load Movieclip From Library Into A Movieclip On The Stage?
Alright I am losing my mind trying to figure out something so simple, I can load external swfs no problem, but How do you access a movieclip from the library?

I have a main swf, and a movieclip in the library named feb93_mov. Basically I want to on MOUSE_DOWN load the library item "feb93_mov" into swfloader_mc on the stage. But I cant write an instance name for "feb93_mov" cause it's not supported, so how do I access it then?

Here is my code what is wrong with it?:


ActionScript Code:
feb93_btn.addEventListener(MouseEvent.MOUSE_DOWN, feb93down);
function feb93down(event:MouseEvent):void
{
    loadMe4();
}

var loadMe4 = function():void
{
        var feb93_mov:MovieClip = new MovieClip();
    swfloader_mc.addChild(feb93_mov);
}

View Replies !    View Related
How To Target A Movieclip Within A Movieclip On The Stage (in A Class)
Peepz,

Im building a scroll class which looks like this:

ActionScript Code:
package { import flash.display.Sprite; import flash.events.MouseEvent; import flash.events.Event; import flash.geom.Rectangle; import flash.display.DisplayObjectContainer import flash.display.MovieClip; public class ContentScroller2  {        //eigen code   private var moveSpeed:Number   private var easingSpeed:Number   private var scrollHeight:Number   private var percentScrolled:Number   private var newY:Number            // how much of the movie can be scrolled   private var scrollable:Number   private var initContentPos:Number        // the drag positions that are possible for the mcDragger   private var left:Number   private var top:Number   private var right:Number   private var bottom:Number   private var scrollWheelSpeed:Number        private var _mcContent:Sprite   private var _mcMask:Sprite   private var _mcDragger:Sprite   private var _mcTrack:Sprite      private var dragBounds:Rectangle;   public function ContentScroller2(mcContent:Sprite, mcMask:Sprite, mcDragger:Sprite, mcTrack:Sprite, ease:Number, setDraggerSize:Boolean = false)   {           _mcContent = mcContent       _mcMask = mcMask       _mcDragger = mcDragger       _mcTrack = mcTrack          moveSpeed = 2;     easingSpeed = 5;     scrollHeight = _mcTrack.height ;              // how much of the movie can be scrolled     scrollable = Math.round(_mcContent.mcRegister.height - mcMask.height);     initContentPos = 12          // the drag positions that are possible for the mcDragger     left = _mcTrack.x;     top = _mcTrack.y + 26;     right = _mcTrack.x;     bottom = _mcTrack.height - _mcDragger.height + _mcTrack.y     scrollWheelSpeed = 30;              dragBounds = new Rectangle(_mcDragger.x, _mcDragger.y, 0, _mcTrack.height - _mcDragger.height);          initHorizontal();   }        private function initHorizontal():void     {         // before we do anything make sure the content is even scrollable, if it isn't hide everything and return         if (scrollable<0)         {             _mcDragger.visible = false;             _mcTrack.visible = false             //btnDown.enabled = false;             return;                          _mcContent.removeEventListener(Event.ENTER_FRAME, updateContentPos);         }           else         {             addListeners();         }     }        private function addListeners():void {                          _mcDragger.addEventListener(MouseEvent.MOUSE_DOWN,   draggerDown);         _mcDragger.addEventListener(MouseEvent.MOUSE_UP, removeDraggerEvents);     }        private function draggerDown (me:MouseEvent):void {                          _mcDragger.startDrag(false, dragBounds);                 _mcDragger.addEventListener(MouseEvent.MOUSE_MOVE,   draggerMouseMove);         //_mcContent.addEventListener(Event.ENTER_FRAME, updateContentPos);     }          private function draggerMouseMove (me:MouseEvent):void {         updateContentPos();     }          private function removeDraggerEvents (me:MouseEvent):void {         _mcContent.removeEventListener(Event.ENTER_FRAME, updateContentPos);         _mcDragger.removeEventListener(MouseEvent.MOUSE_MO  VE, draggerMouseMove);         _mcDragger.stopDrag();     }          private function updateContentPos ():void     {         percentScrolled = (_mcDragger.y-top)/(scrollHeight-_mcDragger.height);                 // instead of setting the _y property directly, we simple set newY         // that way we can adjust how we handle the new Y coordinate we'd like to move to         newY = Math.round(initContentPos-(percentScrolled*scrollable));                 trace(percentScrolled)                           _mcContent.y += Math.round((newY-_mcContent.y)/easingSpeed);     } }

i have a code inside my total movie which contains the scroller, the code is:

ActionScript Code:
var myContentScroller:ContentScroller2 = new ContentScroller2(mcContent, mcMask, mcDragger, mcTrack, 3, false)


All the clips like: mcContent, mcMask, mcDragger, mcTrack are on the stage.
To use this MC's well i have to (or maybe not) i have to "re-assign" them in the package like (maybe there is a cleaner and better way?):

ActionScript Code:
_mcContent = mcContent _mcMask = mcMask _mcDragger = mcDragger _mcTrack = mcTrack


but now my final question is how can i target the movieClip "mcRegister" which is inside "mcContent" on the stage? (in AS1 it was like mcContent.mcRegister but that wont work.)
the code in the package is like:

ActionScript Code:
scrollable = Math.round(_mcContent.mcRegister.height - mcMask.height);


Hope somebody can help me out!

Greetz!

View Replies !    View Related
Move A MC To A Different Location With A Button
I am having a problem: I want to move a MC from one location to another, using a button on another menu. tab1 is the name of the instance. When I use
on ( rollover ) { tab1._y = _y+(280-_y);
}
It moves the MC to the correct location, but it keeps moveing back even if the mouse is still on the button.

On the MC there is the following code (because it should be activated also if someone is rolling over the MC, and not only on the separate button):
onClipEvent (load) {
headline = "test1";
text = "blablablablablablablablablablablablablablablablab la";
trigger = 0;
}
onClipEvent (enterFrame) {
if (trigger == 1) {
_y = _y+(300-_y)/6;

}
if (trigger == 0) {
_y = _y+(425-_y)/10;

}
}
Please help!
Thanks

View Replies !    View Related
Get Path/location Of Button
In AS3 I'm trying to refer to a button and I can't get the correct location. How can I read the location of a display object.

eg. by placing something like:

trace(this.location);

on the button. Which might return

_root.movie1.movie2.instancename

View Replies !    View Related
Button Location And Button Link
any one help me with this;

I have a button that is buried in a movie clip (MC2) that is within another MC (MC1) on the main scene/timeline (TL) - complicated, but necessary.

I need the button action to move the MC1 to a specified spot.

I've tried this;

on (release) {
_root.MC1.gotoAndPlay("PlaceNameOnMC1Timeline");
}


which isnt' working. Anyone help please?

View Replies !    View Related
Button Checking Mc`s Location In The Scene
Hello!

Again im in need of help.

This time i want to make a button to check if an mc is loaded into the same frame that the button is and than set alpha to that mc else not.
The buttons are also in an mc.


[Edited by Aare on 05-21-2002 at 10:49 AM]

View Replies !    View Related
Changing Y Location On Button Press
I'm trying to get the y position of a movie clip to change upon a button press.

i thought, that by using the code below i could get it to move from y position 400 to y position 168.

Any ideas on where I went wrong?


Code:
changepos = function (display:String) {
movieclip._y = 400;
this[display]._y = 168;
}

button1.onRelease = function() {
changepos("movieclip");
}

View Replies !    View Related
Changing Y Location On Button Press
I'm trying to get the y position of a movie clip to change upon a button press.

i thought, that by using the code below i could get it to move from y position 400 to y position 168.

Any ideas on where I went wrong?


Code:
changepos = function (display:String) {
movieclip._y = 400;
this[display]._y = 168;
}

button1.onRelease = function() {
changepos("movieclip");
}

View Replies !    View Related
How To Move An Object Slowly And Smoothly From Location 1 To Location 2?
Hi,

I am new to ActionScript. I wish to use ActionScript to move an object slowly and smoothly from location 1 to location 2.

I learned that I can use the following to move an object to location 2 (x2, y2):

mThisObject.x = x2;
mThisObject.y = y2;

However the object just "swift" from location 1 to location 2, not moving slowly and smoothly from location 1 to location 2.

Could some experts here provide a guideline for me?

Thanks and best regards

Alex

View Replies !    View Related
Load Movieclip Into A Movieclip On Stage
On the loading of my page, I need to load an english text movieclip into one that's on stage. Also on stage is a button to push for the Japanese translation. When this button is pushed, I need to load the japanese movieclip into the place where the english version is and for the english to go away. How do I do this?

View Replies !    View Related
Movieclip Referencing Another MovieClip On Stage
Hi all,
I have a movieclip with dynamically loaded content in a movieclip that sits on the stage, which works fine, it loads the content fine. Call it Clip A
I want multiple movieclips to reference this movieclips content. ie I want a copy of this Clip A to appear in multiple movieclips.

Real example
Clip A loads teamshirt Arsenal
Multiple clips to also have Arsenal teamshirt by looking at ClipA

Any ideas? Do i go about it using loadMovie and pointing it to the scene or attachMovie?

thank you in advance
Jason

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved