Help With _x And _y Movie Properties
I havn't taken any classes on Flash, so bare please.
Let's say I have a scene. In that scene is a movie clip named "Billy Bob". Also in that scence are 4 buttons, buttons that I want to move "Billy Bob" up, down, left, and right with.
My problem is just getting those buttons to access the _x and _y variables of "Billy Bob." Fact is I'm just clueless on the syntax.
Could someone give me an example of what I could put in the actions of one of the buttons? I'm talking an "on (release)" thing, I'll worry about smooth scrolling later.
Thanks!
FlashKit > Flash Help > Flash ActionScript
Posted on: 04-15-2002, 07:15 PM
View Complete Forum Thread with Replies
Sponsored Links:
Swf Movie Properties
I want to upload my high dynamic menu-swf; next problem
HOW TO SET THE BACKGROUND of the swf to transparant? I like to use this menu into a frame.....I load it into the HTML page (dreamweaver) but of course you can see the contours because it is white background.I can of course use another layer and show the background ther ....but I am afraight for big download sizes!
I like to set the background of the frame in Dreamweaver to the same background....
Kind regards
View Replies !
View Related
Movie Properties
I'm trying to retrieve the hieght of the movie. I've tried using _root._height but what I get back constanly changes. I'm confused doesn't _root. reference the movie properties? If someone could give me a little direction here I would appreciate it.
TIA,
Dan
View Replies !
View Related
Movie Properties
What is the best layout a new movie? I know the default is 550 x 400 pixels. Should I leave it at that or change to inches. Does it have anything to do with the screen resolution?
Any help would be appreciated.
Taz
View Replies !
View Related
Movie Properties
I created a movie large enough to spread across four screens, <2100 x 1550>. I now want to re-size the movie so it can be shown on one screen in a presentation. <550 x 400>. Is there a way to do this without having to resize all of the elements in the movie - and basically having to recreate the entire movie?
Thanks for your help!
View Replies !
View Related
Get Movie Stage Properties
HI all
I would like to set a variable which equals the width of my stage. I have done this before some time ago in Flash 4 (if you can remember back that far ) and think it is something like -
movie_width = getProperty (movie,_width );
So when ever I resize my stage the variable 'movie_width' always applies.
Can you help? Thanks.
View Replies !
View Related
Changing Movie Properties
Im trying to move a movie with an action script by chaning the X and Y properties and and constantly adding each frame until it reaches the movie height or width. I forgot how to do this and if someone could post it it would be helpful.
View Replies !
View Related
HELP With Loaded Movie Properties
Hi, I'm looking for help with changing the alpha of a loaded movie(in this case a jpg). I want to load it externally because I am loading a few jpgs each about 50kb so I do not want the file size to be so large.
After I use
loadMovie("blah.jpg",1);
how could I change the alpha (so it would fade away) after 5 seconds. In the end result I would like to load 3 jpgs. When the next one was loaded, wait 5 seconds and fade out the last one, now showing the one that was just loaded. ETC>
I hope this makes sense... I have accomplished this on the stage but the file seems too large and is therefore a bit slow. I can load external jpgs but I really need help in determining if the next one is loaded, WAITING 5 secs, and then fading out.
ANY ADVICE IS GREATLY APPRECIATED.
THANKS =)
View Replies !
View Related
Movie Clip Properties
I'm in the middle of an endeavour to recreate Sonic 2 in flash and have recently hit a wall. In order to emulate the game's physics I need to be able to change the speed at which various animations/movie clips play.
Has anyone found a way to set a frames per second property for an individual movie clip?
I may have missed it but please point it out if that's the case.
-Regards
Zantei
View Replies !
View Related
External Movie Properties
In my movie I have a button that loads an external movie...
on (press) {
loadmovie("news.swf", 2);
}
and I want to get the loaded bytes and total bytes of that movie via the getbytestotal() and getbytesloaded() functions. But... how do I say <news.swf>.getbytesloaded and <news.swf>.getbytestotal() ?
in other words what do I address "news.swf" as so that I can get the bytes loaded and bytes total of that movie from the parent movie?
thanks in advance,
--metalguy
View Replies !
View Related
Movie Properties - Match
Hello.
I understand more or less the purpose of the Printer and Contents of the Movie Properties. But I was wondering if someone here could explain it, in a more simple way as it is on the manual of Flash.
View Replies !
View Related
Shaped Movie Properties?
I dont think this is possible but maybe it is, I have a site that is going to be flash and html, 3 flash movies shaped like a "n", flash on left, top and right with html in the middle. One is catogories, one is sub-catogories and the other is titles. Now if I have to use these three movies I will have to come up with a whole lot of movies because of all the different options. This makes it hard to do revisions because you have to change so many. So I need to find a way to either make a "n" shaped movie or an easy way to pass varibles from the movies. Any Ideas - thanks in advance.
View Replies !
View Related
Loaded Movie Properties
So I have a blank movie which I'm loading another movie into. I thought that when I loaded the movie into it, that it would inherit the empty movies size, but I was wrong. So my question is, When loading a movie into a blank movie with a specific size (mines a box), how do you get the loaded movie to inherit the empty movies size.
View Replies !
View Related
Load Movie Properties?
target_mc.loadMovie.("blade.swf");
I am using this to load an external SWF file, but I would like to set the width and height properties for the movie that loads. How can I accomplish this?
View Replies !
View Related
Properties Of A Loaded Movie
I'm loading an swf into a movie clip on my stage, but I then want to center it. Since I may be updating this swf I'm loading in the future, I'd rather not hard code the size of the swf in order to center it. But when I try to use the _width property of the movie clip I load it into after it's loaded, the _width remains 0.
Is there any way around this?
View Replies !
View Related
Movie Clip Properties
I've been pulling my hair out trying to get a similar mouse effect as the one in this link:
http://www.trts.com/welcome/around.swf
I know it has something involving duplicateMovieClip and color values of that movie clip, but I'm not getting very far. Something like this might be out of my league at the moment, but I'm still curious as to how I would implement something like these mouse trails that float around. Anyone know of a similar tutorial, or a good place to start? Maybe a synopsis of how this type of thing is achieved?
Thanks for your help.
View Replies !
View Related
Help On Movie Clip Set Properties
Okay, heres the deal. I have a good guy and a bad guy. Its stop time control, so, the bad guy only acts when the good guy does. the thing is, the good guy can only move horizontially or vertically while the bad guy can only move diagonally torwards the good guy, where theres is a collision and then game over. My questions are as follows;
1. How can I make it so that the bad guy will always go towards the good guy
2. Can I set up a collision detection that sends an effect only when the bad guy sprite is 100% covering the good guy sprite, and how.
Please help. I beg of you.
View Replies !
View Related
Help On Movie Clip Set Properties
Okay, heres the deal. I have a good guy and a bad guy. Its stop time control, so, the bad guy only acts when the good guy does. the thing is, the good guy can only move horizontially or vertically while the bad guy can only move diagonally torwards the good guy, where theres is a collision and then game over. My questions are as follows;
1. How can I make it so that the bad guy will always go towards the good guy
2. Can I set up a collision detection that sends an effect only when the bad guy sprite is 100% covering the good guy sprite, and how.
Please help. I beg of you.
View Replies !
View Related
Properties Of A Movie Clip?
Hey there,
I'm trying to record all properties of a movie-clip (or of an object, or whatever) and save them to an array, so that I can reuse the info later on. This is fine if I add stuff to the movieclip/object, and only need to see that, but I'm hoping to get a quick way to iterate through all properties (like, say, x,y,alpha,rotation,etc).
If I do something like:
for (prop in myClip) {
trace(prop + " : " + myClip[prop]);
}
I get nothing, unless I've specified a clip property at run-time. I've tried making all of the prototype settings in the MovieClip class accessible (via ASSetPropFlags), but have succeeded only in making the methods of the clip visible.
Help?
View Replies !
View Related
Retrieving Properties Of Loaded Movie
Hi all,
I'm trying to retrieve the width property of an swf loaded into a movieclip called 'placeholder'. Here's my code placed on the frame _after_ the loadmovie action (the movie loads fine):
----------------
width = placeholder._width;
if (width <= 115){
kader._width = placeholder._width;
}
----------------
I've made a frameloop back to this code. I've seen this done with the _level target but this isn't working with a movieclip target. Why?
Thanks very much for your help.
Danielle.
View Replies !
View Related
Dynamic Change Of Movie Properties
Hi Guys(n Gals too),
I need to knwo if this can be done !
Heres what the problem is
I have made an exe with a blue background, its a full screen thing.On the first scene i want some animation to play with a BLACK background which should extend to the full screen(So i cant just create a black box )
Is there any ways i can do that through actionscript (OR any other way)as long it works...suits me fine ??
Thanks
Sam.
View Replies !
View Related
Movie Clip W/ Button Properties?
I have a movie clip that does random motion and displays a hover caption on mouseover. Is it possible through actionscript to rollover and play a sound as something would do on a button mouseover? I'm pretty sure. Also if I could do a goto certain frame when the movie clip is clicked?
Thx !
View Replies !
View Related
Syntax For Properties In Loaded Movie?
I'm using the code from an fla I got here at flashkit(mouse_scroll by rel.pot), and it works great! Until I load that movie into a movie clip in another movie (called phclip for the example below).
I'm sure it's a quick tweak to the code, but I've tried several things and nothing seems to work.
I tried changing the initial code to:
varimg=_parent.phclip.img;
varbgd =_parent.phclip.bgd;
but that didn't work...
The code I'm using to move the jpg within area1.jpg is:
varimg = _root.img;
varbgd = _root.bgd;
v = 0.1;
//mouse pos
mousex = varbgd._xmouse;
mousey = varbgd._ymouse;
// image pos
imgx = getProperty(varimg, _x);
imgy = getProperty(varimg, _y);
// distance fom the center to the left, right, top and bottom side
left = getProperty(varimg, _width)/2;
right = (getProperty(varimg, _width)/(-2))+(getProperty(varbgd, _width));
top = getProperty(varimg, _height)/2;
bottom = (getProperty(varimg, _height)/(-2))+(getProperty(varbgd, _height));
// scrolling of the image
setProperty(varimg, _x, (imgx+(mousex*v)));
setProperty(varimg, _y, (imgy+(mousey*v)));
// stop the image on the horizontal side
// left
if (getProperty(varimg, _x)>=left) {
if (mousex>0) {
mousex = 0;
setProperty(varimg, _x, left);
} else if (mousex<0) {
mousex = varbgd._xmouse;
setProperty(varimg, _x, (imgx+(mousex*v)));
}
}
// right
if (getProperty(varimg, _x)<=right) {
if (mousex<0) {
mousex = 0;
setProperty(varimg, _x, right);
} else if (mousex>0) {
mousex = varbgd._xmouse;
setProperty(varimg, _x, (imgx+(mousex*v)));
}
}
// stop the image on the vertical side
// top
if (getProperty(varimg, _y)>=top) {
if (mousey>0) {
mousey = 0;
setProperty(varimg, _y, top);
} else if (mousey<0) {
mousey = varbgd._ymouse;
setProperty(varimg, _y, (imgy+(mousey*v)));
}
}
// bottom
if (getProperty(varimg, _y)<=bottom) {
if (mousey<0) {
mousey = 0;
setProperty(varimg, _y, bottom);
} else if (mousey>0) {
mousey = varbgd._ymouse;
setProperty(varimg, _y, (imgy+(mousey*v)));
}
}
// can be deleted, usefull for adjust your image
set("_level0:x", imgx);
set("_level0:mx", mousex);
set("_level0:y", imgy);
set("_level0:my", mousey);
If anyone can tell me how to change this code so it will work within a nested movie clip, that would be GREAT!!!
Thanks,
View Replies !
View Related
Attached Movie Properties Tint...
When attaching a movie... is it possible to change the tint of the item through actionscript.. while attaching 4 identical movieclip... i would like to distinguish between each... right now i know how to attach the movie and change its height and width properties but i have never figured out the color portion of it...
Thanks,
Carlos
View Replies !
View Related
Setting Properties For Movie Clips
I have a movie that begins with a movie clip on the stage.
How do I initialize the movie clip instance so that it is initially invisible. (I eventually want to use a button to make it visible)
I have not had problem setting the instance for commands such as play and stop, but can't get the _visible=false to work.
Where should this code be placed and what would be the right syntax?
View Replies !
View Related
Movie Clip With Button Properties
Hi, I'm using Flash 5 and I've created a MC that loads an external jpg and I want it to act like a thumbnail, so when the user clicks it, it executes the gotoandplay function. I've heard alot of people talking about using preloaders for this kind of thing but I'm not sure if that's what I need to do. Any suggestions?
View Replies !
View Related
Graphic Properties Within A Movie Clip
I have a movie clip. Inside this, is a text heading which is graphic symbol. It goes through several stages (increase in size, change of position and alpha).
I have 10 more text headings which I want to perform the same actions so I am duplicating and renaming the movieclip (no problem) but when I try and duplicate and rename the text heading symbol and type a different text heading, it changes the the text in previous symbol too.
This muct be a common procedure, which I am obviously doing wrong.
View Replies !
View Related
Changing Properties Of An MC Containing A Loaded Movie.
Hi guys!
I have an MC with instance name m1. I load a movie into it called sunset.
Code:
m1.loadMovie ("swf/sunset.swf");
this works. then i position the m1 containing sunset.swf wherever i want.
Code:
m1._x = 20;
m1._y = 20;
I also want the m1 to rezise because the sunset is wider then the movie it is loaded into. So i go:
m1._width = 250;
When i add this, the sunset.swf does not show anymore! I can hear it, but it is nowhere to bee seen. I have tried other values as well. When i put in minus value (-1 and under), it becomes visible but at normal size....
Whay am i doing wring?
View Replies !
View Related
[F8] Changing The Loaded Movie Properties...
I have a flash file similar to this one, i am trying to load an external flash mp3 player with variables like this:
loadMovieNum ("the file.swf?thevariables, 10);
I get the file loaded fine but the pop ups (when you click add comment etc) are coming up underneath the loaded file.
I've tried a variation of levels but no dice.
I even tried to load it into a movie clip, but for some reason that doesnt work, so i'm not sure if that is because of the variables or what.
The flash file shows other stuff it shouldnt do.
advice?
View Replies !
View Related
Adjusting The Properties Of An External Movie.
Hi there,
I would like to know some tips for adjusting the window size, etc. of an external movie. I have the link set up, but it opens the movie too big, I need to know how to adjust the size.
Code:
on (release) {
//load Movie Behavior
if(this == Number(this)){
loadMovieNum("create_new_role.swf",this);
} else {
this.loadMovie("create_new_role.swf");
}
//End Behavior
}
View Replies !
View Related
Watch Properties Of All Movie Clips
Hi,
I need to watch the _visible property of all movie clips created in the movie, wherever they are.
I'm thinking I need to assign the watch on the prototype of the MovieClip class, but I'm not sure how to do this.
Code:
MovieClip.prototype.watch("_visible", somefunc, 0);
does not seem to work.
Maybe I need to overload the constructor of MovieClip and set up the watch there? But I have no idea what's in the constructor already to set it up correctly.
Any pointers?
Thanx
--
mm
View Replies !
View Related
Keeping Movie Clip Properties?
hey fellow flash peeps,
(for the question go to the bit under the left pointing arrows)
in my current experiment i have played around with duplicating movie clips..... the movie clip i duplicate has a button on the first frame that once click moves the MC to frame 2, this frame has a read button on it. As a seperate Mc i have a red line moving from left to right accross the screen, i have script telling the red line ( if it hits the red button then play the linked attached sound. ( i think this can also be done using arays [o,1]-type thing,,,,, but lets not get into that now....Muhahaha!)
my problem is that once the movie clip is duplicated the button works the move to the 2nd frame(red button) but when the red line Mc hits it the linked attached sound does not pla.....so i supose my question is.....
><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
is there a way to duplicate a mc and keep all its propeties.....?
when a movie clip is duplicated does it loose the originals instance name or something????
hope this makes sense....
regards
View Replies !
View Related
How Do I Use A Variable To Set Movie Clip Properties?
I'm building a simple contact page that allows users to select a city from a comboBox. I'd like to pass the selected comboBox data through a variable that controls a movie clip with the same name. (already on the stage)
locationListener.change = function (loc_obj:Object) {
var loc_mc = loc_obj.target.selectedItem.data;
loc_mc._visible = true;
So far this hasn't worked. I've tested hardcoding the movie clip instance name (Atlanta._visible = true) and it works, but I can't figure out why using the variable loc_mc won't trigger interaction with the movie clip.
Something simple, I assume. Thanks in advance for any help.
Edited: 08/22/2007 at 11:34:40 AM by LDJ3
View Replies !
View Related
Trace Movie Clip Properties
Hi,
I want to trace all the names of a Movie clip properties. Funny thing is that I used to know how to do that. Now when i use
for(var sKey:String in mcMovieClip) {
trace(sKey);
}
It only traces the names of nested Movie Clips not also properties like _x, _width. Anyone knows how to do that?
View Replies !
View Related
Changing Movie Clip Properties
I have a movie clip on the stage called ball_mc. I have a button called yscale_btn with an input text field next to it called yscale_txt. I'd like to take the input value to transform the scaleY property of ball_mc. Here's my code:
Code:
var yscale_txt:Number;
yscale_btn.addEventListener(MouseEvent.CLICK, yScale);
function yScale(event:MouseEvent):void {
ball_mc.scaleY = yscale_txt;
}
There are no compile or script errors. When I test the movie though, any value that I put into the text field, even 0.0002, makes the scaleY so great that the clip goes off the stage. What am I doing wrong here?
View Replies !
View Related
Using A String To Change Movie Properties
Sorry about the title. I'm not really sure what I'm looking for (that's probably why I can't find help)
I have say 50 movie clips on the stage. each has a name like "button1", "button2" etc and I want to move each one using a for loop instead of hard coding "button1._x = 50"
When I try this it doesn't work.
Code:
var buttonName = "button1";
buttonName._x = 50;
Can anyone steer me in the right direction with this?
View Replies !
View Related
Updating Movie Properties At Runtime
I am reading in XML data that describes a kind of linked list tree into Flash 5 and then converting the data into a graphical representation. At design time I don't know how many nodes there will be in the tree so I don't really know the dimensions I should make my flash movie object. Is there a way to update my movie's height and width at runtime? Another thing I've noticed is that when I publish the HTML specifies the width and height with tags so it looks like I would need to somehow update those values as well. If you have any ideas about this let me know. Thanks...
View Replies !
View Related
ActionScript: Setting Movie Properties
I need to set a movie clip, that serves as a floating menu, back to it's starting point.
I need to know how to set the xy position through script. I've been trying things with this so far, set on a button instance.
ActionScript Code:
on (release) {
with (_root.Menu) {
_x = 72;
}
}
something like that. Obviously it is not working.
View Replies !
View Related
Movie In A Movie Properties & Variables HELP PLEASE
Hello fellow flash users!
Can you help?
I have a main large movie that has a smaller blank movie within it called "Blank".
When i click the menu buttons i can load external .swf pages into the "Blank" movie with no problems BUT if i load a game into the "Blank" movie i find that the games properties and variables are not working?
If i load .swf pages that have no properties or variable then all works well but games with variables do no work.
The actual game has its properties set and variables set at the first frame and the game on its own works fine.
But when loaded into "Blank" of the large movie then the game runs but the properties such as visability are ignored.
Can you please help, Many thanks!
Ron
View Replies !
View Related
Creating Custom Movie Clip Properties
I have numerous instances of the same movies clip. I need to have some object properties which are set to different values for each instance.
Example:
Various instances of a movie clip which is an icon graphic. Each icon graphic goes to a different URL when clicked on. So, I need a way to store the value of the destination URL inside an object property for each instance of the icon graphic...
Thanks for any ideas
Oh, by the way, all the icon graphics are in the same frame. They are created on the fly from a database result-set so the amount of them and where they point will vary. That's why I pile them all into one frame.
View Replies !
View Related
Changing Properties Of Dulplicated Movie Clips
So, I'm sure there is an easy way to do this, but I have no Idea how its done.
I have a movie clip that I want to duplicate say 20 times and I want to change the properties of the clip and change the properties of another clip based on a duplicated movie clip. If that doesn't make sence lets try this.
button 1 -- action script
on(release) {
foo = 0;
while(foo < 20) {
duplicateMovieClip("_root.dot", "dot" + foo, foo);
setProperty("dot" + foo, _x, ((_root.("dot" + foo)._x))+20);
foo++;
}
As you can see I'm just trying to bump the new duplicate over by 20 from the position of the previous duplicate.
Adam
View Replies !
View Related
Can't Manipulate Textfield Properties In Movie Clip
I have a movie clip (containing a button that contains text) that I've brought into my main movie via attachMovie. I can manipulate properties of any elements and symbols in the clip except the text on the button. I need to be able to make this text autosized so that I can space it out properly (several of these clips are dynamically attached and positioned from xml). I have no idea what the problem is.
Here's a bit of the code (theButton is the button and buttonText is the text on the button):
for (i = 0; i < navText.firstChild.childNodes.length; i++) {
var theSubNav = eval("_root.totalSubNav." + navText.firstChild.childNodes[i].attributes.navbar);
nextxPosition = 50;
for (x = 0; x < navText.firstChild.childNodes[i].childNodes.length; x++) {
newObjName = "open" + x;
if (navText.firstChild.childNodes[i].childNodes[x].nodeName == "independent") {
theSubNav.attachMovie("independentButton", newObjName, x);
thisButton = eval("theSubNav." + newObjName);
thisText = navText.firstChild.childNodes[i].childNodes[x].attributes.title
thisButton.theText = thisText;
thisButton.theButton.buttonText.autoSize = true;
thisButton.goesTo = navText.firstChild.childNodes[i].childNodes[x].nodeValue;
thisButton._x = nextxPosition;
thisButton._y = -0.1;
nextxposition = nextxPosition + thisButton.theButton.buttonText._width + 20;
Any thoughts?
View Replies !
View Related
|