[F8] Have MC Find Empty Position
Ok - I'll try it over here.... (also posted in Flash 8 section)
The easiest way to see what I want to do is to look at the attsched pdf.
Short in word - I have moveclip A, B and C - the menue is vertical - and the movieclips are at bottom of the stage. When clicked they slide up to the top of the stage and a submenue is revealed. The thing is that if the movieclip C is clicked it leaves an empty space under B. I would like B to fall into that empty space - and A, consequently to take the position where B was. Get it?
I can make the clips slide into a defined position - the question is how do I tell a movieclip that there is a free space below it and it should move down there?
Beats me...
FlashKit > Flash Help > Flash ActionScript
Posted on: 10-06-2006, 10:02 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
My 'find' Won't Find Empty Lines And } Now
on 750 buttons I'm trying to go from:
{
Sound01
}
}
}
to:
{Sound01}
by deleting the empty lines and these } using find & replace - and when I hit replace all - it says none found, even though I copy directly from button code...
Is possible this happened by earlier having copied code from AS window - pasting it onto main stage to hold it while busy doing something else - then later double-clicking it and copying it into the find/replace window - which strangely puts little squares in wherever there was a carriage return??? Help please.
How To Position Mc_example Depending On Position Of Empty Movieclip?
I have a series of movieclips (graphics) which I want to position in a row.
I know that I can define the position of each movieclip individually by _x and _y. But can I place an empty MC on the stage and define the position of every single MC with _x and _y IN RESPECT TO THE POSITION OF THE EMPTY MC - so that ALL movieclips will change their position when I move the empty mc?
Thanks for helping
Aribert
Find Out The Input Text Filed Is Empty
In flash mx 2003. I have a problem, if a input text filed is empty then a particular action is done and else a particular action is done. but, I found that it dose not work. Please find out the attachment and solved the my problem. my cord is
function check_1()
{
if(ans=="")
{
gotoAndPlay("incorrect");
}
else
{
gotoAndPlay("correct");
}
}
Position Empty Mc By Orientation Of Another Object...?
hi all!
what i mean by this is i have a buttonclip (a mc which hold all of my buttons) and i want an empty mc to position itself to the buttonclips lower left corner.
is this possible?
buttonclip is instance named 'buttonclip' and my empty mc is instance named 'emptyMC'.
thanks!
Can Not Position An Empty Movie Clip With Levels
hi.
Another question about loading in empty mcs...
I can not fix the position of an empty mc. It always appears on x / y positions -0- even if I define its coordinate in the code...Could somebody tell me why ??
Here is my function.
Menu1.onRelease = function() {
this.createEmptyMovieClip("container", this.getNextHighestDepth);
loadMovie("squarezoom.swf", 1);
container._x = 150;
container._y = 45;
_level0._visible = 0;
};
Thank you.
How Do You Find A Duplicated MC's Position?
Hi all,
I have an MC "a1" that I'm duplicating and arraying downward a variable number of times ("numb"). The MC is inside a parent MC ("little") which is inside the MC ("big"). My problem is how to determine the Y position on the screen of the last or lowest duplicated MC (in the example: a22). The code below shows its y position relative to its parent MC. Is there some way to get its absolute or "screen" y position?
numb=22;
ypos=eval("_root.big.little.a"+numb);
lowest=(getProperty (ypos, _y ));
thanks in advance
How To Find The Ending Position
I want to play some animation after the sound file end. for example I add a sound file.. that linkage name is snd
sound1=new Sound();
sound1.attachSound("snd");
sound1.start();
my name want to flash after the sound file come to end. I don’t know how to find the ending position. Please some one help me……
.
How To Find The Ending Position
I want to play some animation after the sound file end. for example I add a sound file.. that linkage name is snd
sound1=new Sound();
sound1.attachSound("snd");
sound1.start();
my name want to flash after the sound file come to end. I don’t know how to find the ending position. Please some one help me……
Flash MX 2004 Actionscript help needed!!!!
Find The Length Of A Position
how to find the length of a given position , e.g a(x,y) and b (x,y), i want to find out the length of a to b, any function to use? thanks
Find The Position Of The Menu
Hi,
I'm new to the Flash. I want to create the menu dynamically from xml. And I want to know the posisition of the menu. I drag the menu component from Components option.
How to do this? help me. I searched in google, but not getting any correct solution,
Help me to do this.
Thanks in advance
Trying To Find The Position Of A Sound File
I have a very simple player that I built for a site to play clips of songs. The player itself is only the size of the play/stop button. I'm having a little trouble as to where I place the if statement to check for when it reaches the 30 second mark to stop playing. Can anyone help me out?
Code:
//Setup the sound object
var sObject:Sound = new Sound();
var sDur:Number = sObject.duration;
var sPos:Number = sObject.position;
sObject.setVolume(75);
var Playing:Number = 0;
//Create an array that holds the song
var saUrl:Array = new Array();
//Load the xml file
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
var nodes:Array = this.firstChild.childNodes;
saUrl.push(nodes[0].attributes.songurl);
sObject.loadSound(saUrl[0], true);
}
play_btn.onRelease = function()
{
if(Playing == 0)
{
Playing = 1;
xml.load("http://www.url.com/music/store_xml.php?s=19");
_level0.play_btn.gotoAndStop(5);
}
else
{
Playing = 0;
_level0.play_btn.gotoAndStop(1);
this._parent.sObject.stop();
}
}
Find Clear Position For A Picture
Dudes, i need some help here:
I Need do a gallery with images with diferents sizes, and all that is on a organic position, basicly i need a function to search a clar slots in a space of 5000x5000, someone can help me with this?
Find Corner Of Mc Regardless Of Registration Point Position
Hello again,
Does anyone know of a way to find the top left corner (for example) of an mc regardless of where it's registration point is?
What I mean is how do I determine where the registration point is for an MC?
This is kinda what I am trying to accomplish: A user mouses over something and no matter what size it is, or where it's registration point is a box will appear right at the top left corner. Not including curves - there are no curves.
Thanks for the help.
webg
How Can I Find Out The Position Of A Math.random Object?
HI
How can I find out the position of a Math.random() object that just dropped down the stage?
The movieClips drop down the stage randomly, but sometimes, they are to close to each other. I want to find out the "old"-position of the last object that dropped to the stage and than set the "new"-position +20.
I couldn't find a solution so far and hope you could help me tonight...?
This is what I've got so far:
ActionScript Code:
var ufo_timer:Timer = new Timer(4000);
ufo_timer.addEventListener(TimerEvent.TIMER, addUfo);
var ufo01_mc:Ufo01;
var position:Number;
var maxLimit:uint = 50;
var minLimit:uint = 750;
var range = maxLimit - minLimit;
function addUfo(e:TimerEvent){
ufo01_mc = new Ufo01();
addChild(ufo01_mc);
//trace(Math.random());
position = Math.ceil(Math.random() * range) + minLimit;
[b]//if(old position, set new +20)[/b]
ufo01_mc.x = position;
ufo01_mc.y = 10;
ufo01_mc.addEventListener(Event.ENTER_FRAME, moveUfo);
}
Find Nearest Theta(circle) Position
I have objects that fly around randomly.
When the objects come near to a ball they turn around the ball.
With this code:
ActionScript Code:
var degreeIncrement = rpm
theta += degreeIncrement;
theta %= 360;
const DEG_TO_RAD:Number = Math.PI / 180;
var radians:Number = DEG_TO_RAD*theta;
this.x += Math.cos(radians)*Pradius*Direction
this.y += Math.sin(radians)*Pradius
Because theta tells them where they should go they should go in the circle the object sometimes go right through the ball to get to this point. But I don't want the objects to go through the ball when they start to turn around. I want the objects to find the theta position nearest to them, so they won't go through the ball.
Anybody have an idea how to do that?
If my question isn't clear enough please tell me.
HELP, Dynamically Find Movie Clips Position.
Is there a way in actionscript that I can find a movie clips position on the stage.
For example:
If I create a star graphic, then convert it into a movie clip manually, is there any way I can get its position via actionscript?
THANKS!!
HELP: Find Position Of Word In Assoc Array
Hi all,
I'm trying to make a function that searchs an assoc array for a word and then returns its position in the array, but so far it's not working. Any know what I'm doing wrong?
ActionScript Code:
var aNames:Array = new Array({fname:"John", lname:"Smith"}, {fname:"Jake", lname:"Lane"}, {fname:"Owen", lname:"Bridge"});
//
trace("Word is at pos: "+wordPos(aNames, fname, "Owen"));
//
function wordPos(array, assoc, word) {
for (i=0; i<array.length; i++) {
if (array[i].assoc == word) {
return i;
}
}
}
Grabbing The Empty Space Of An Empty Movie Clip
OK, so I've created an emptymovie clip and have attached clips to it, so that when I attach a drag action (actually, I did the drag through onPress and onRelease), the user can click and drag all the clips at once. However, it only detects when I click on one of the actual child clips...I'd like to be able to click on the space between the clips.
Here's the swf:
http://www.public.iastate.edu/~dnguy.../scrapbook.swf
The relevant code:
Code:
this.createEmptyMovieClip("mainclip", 1);
for(var i=0; i < nPics; i++){
var cclip = mainclip.createEmptyMovieClip("clip_"+fileNames[i], i);
myMCL.loadClip( gFolder + "/" +
fileNames[i],
cclip);
}
Code:
mainclip.onPress = function(){
this.xoff = this._xmouse;
this.yoff = this._ymouse;
this.onMouseMove = DragClip;
}
mainclip.onRelease = function(){
mainclip.onMouseMove = null;
}
function DragClip(){
this._x = _root._xmouse - this.xoff;
this._y = _root._ymouse - this.yoff;
}
Very Weird... Empty/non-empty Button Problem/bug
hey... i was just messing around when i had this code
ActionScript Code:
txt.autoSize = "left";btn.onRelease = function(){trace("it doesnt work!");}btn._width = txt._width;txt2.autoSize = "left";btn2.onRelease = function(){trace("it works!");}btn2._width = txt._width;
as you have read, the one does work and the other doesnt... that's quite weird because there almost the same buttons (not movieclips, buttons)... EXCEPT for this: the one that doesnt work is empty (only the hit tab is filled with a shape) and the other one has the up and hit area filled... i attached i fla to make it more clear
who has a good explanation for this problem(/bug)
How To Check Is An Empty MovieClip Is Really Empty?
I'm creating an empty movieClip that will load a new .swf (from a _global variable) if the empty movieClip is really empty. Unfortunately, I'm not really sure how to check to see if it's empty. Any suggestions would be appreciated.
My code currently looks like this:
// Initialize variables
_global.sceneVar = "CiA_Master2.swf";
// creat empty movie clip
var container:MovieClip = createEmptyMovieClip("container", 2);
var mcLoader:MovieClipLoader = new MovieClipLoader();
//"IF" statement would go on this line, perhaps something like this (?): if(container = "") {
mcLoader.loadClip(sceneVar, container);
//end "IF" statement
I'm hoping to use this in a master .swf that will load other modular .swf files into it.
Empty Frame Not Really Empty?
Hey,
Ok, this may be confusing but I'll do my best to explain it. I have a movie clip, we'll call it frustratingMC, with some code on it. This code draws something onto the stage (the parent of the movie clip) based on the movie clip's position. it's built this way because you are supposed to just be able to drag the movie clip onto the stage and be done with it. The thing is, if I put frustratingMC onto a keyframe on the stage, and a later keyframe does not have frustratingMC on it, I still get frustratingMC in the list when I run this code to see what's on the stage:
Code:
for(var a in _root) {
trace(a);
}
I've tried the same thing with a regular movie clip with no drawing code on it and that movie clip gets removed from the list like I would think it should. I could understand maybe if the drawn stuff didn't go away, but shouldn't frustratingMC go away? Thanks.
--dan
Reset Movie Clip X-position & Y-position Back To Original
Is there a command to reset x-position, y-position and rotation all at once...like reset command?...or would I have to find the original x-positions and y-positions to all elements and hardcode that back....EEEK!!
Many Thanks
Andrea
SoundChannel.position - Trouble Triggering Event Based On .position
I would like to trigger an addChild event when my mp3 reaches a certain point.
My trace statements will only fire if I use <= but not ==
The goal is to add text to the stage when the MP3 has reached one second, what am I missing?
Ultimately there will be several trigger marks I need to hit along the MP3.
ActionScript Code:
var buffer:SoundLoaderContext = new SoundLoaderContext(10000);var welcome:Sound = new Sound(new URLRequest("Intro.mp3"), buffer);var welcomesc:SoundChannel = welcome.play();addEventListener(Event.ENTER_FRAME, playMessage);function playMessage(event:Event):void{trace(Math.floor(welcomesc.position));if (welcomesc.position == 1000) { trace("NOW!!!!!!!"); } else { trace("WAIT-------------"); }welcomesc.addEventListener(Event.SOUND_COMPLETE, soundComplete);}
[F8] Control Position Of Playhead In Movieclip By Position Of A Button
I am fairly new to actionscripting and just need a little help.
I have a bar which has a slideable block on it. When this block is dragged, to the left/right i want it to control the playhead inside another movieclip.
For example, when the block is to the far left, the playhead (of my movieclip) will be at the first frame. When the block is dragged to the right it will play the movieclip at the speed that the block is being moved and when it is at the far right it will be on the last frame of the movieclip. And when the block is dragged to the left it will play the movie backwards at the same speed etc...
It is just like the scrubber bars that are in media players, but instead of playing an actual video, i want to play the movieclip which is of an animation.
How would I do this?
Thanks
Flash Y Position Converted To Browser Scroll Position
I have a Flash movie that makes an fscommand call to the HTML page, and via Javascript, it moves the browser window scroll position down. I need to be able to scroll down to a position that coincides with a Y position on my Flash page, but I can't seem to figure out how to convert coordinates from a Flash Y position to a browser-window vertical scroll position. I hope this makes sense. Does anyone know how to do this? (I have all the code working to do this, except for this coordinate issue. That's the only part I need.)
Example:
Code:
myMC.onRelease = function() {
//Command to Javascript function in html doc
//Scroll down in browser to Y pos specified
//This scrolls down to 1000 position within browser window but
//but does NOT equate to a Y position of 1000 in .swf movie
//even if .swf movie is at 0,0 left & top margins within browser
fscommand("scrollToAnchor",1000);
};
Ultimately, what I am trying to do is simulate anchor points from HTML (not anchor points in Flash to go 'Back'), whereby you have a link at the top of the page, and you click it and it takes you somewhere else lower on the same page. Then you have a link there that says "Back to top", and it takes you back to the top of the page, etc.
Any ideas?
X Position? Y Position? Differs In MovieClips From _root?
Hey!
I'm confused:
I want to move a movieClip that is embedded in another movieClip:
firstMovieClip >> floatingMovieClip
Now, X = 0 IS NOT the upper left corner when I try to direct floatingMovieClip.
When I investigate the movieClip sets it's X = 0 in the middle. But on _root lever, X = 0 is the upper left corner.
Is it supposed to be this silly way?
THanks!
Regards
Help With Tweening From Current Position To Clicked Position
Hi
I have a motion tweening question-
I have a large rotary dial with an arrow on it, around that are 5 buttons. I want to set it up so that when the user clicks any button, the rotary dial will rotate until the arrow is pointing to that particular button. I can't figure out how to make it so that the dial tweens from one position to the other, which is of course dicated by where the user clicks. I also want that dial to stay pointed to that specific button until another one is clicked.
How can I do this?
Thanks!!!
-Steve
Mouse X Position To Control Movie Position?
Hi, my understanding of actionscript is very basic and I'd like some help with writing a very simple script. Basically the x position of the mouse should control the play position of a movie. Do I need something like an event handler (I'm not sure exactly what these do, but I've seen similar scripts that seem to use them).
Reported X Position Doesn't = Actual X Position?
I can't figure this out. I'm loading a serious of pages of images in the same flash document, but all pages after the first one have a lower y position of about the height of one of the images. When I trace their y position they all say 30, when it's clearly more like 150. What's going on here?
I ?guess? It Is About _x.position And _y.position
My Flash 5 file attached !
When you hit button 2 and 4, you will see the word "Congratulations"
Now I would like the word just appear in the yellow area.
"You nerd - just drag the Congrats Clip in the yellow area, that's it" Hehe I know that but in my real program I have more than 110 clips which almost fill up my screen. Therefore I do not want to overlap tons of clips.
Position Of Mouse = Position Of MC
How would I tell a movie clip to move along with the mouse without dragging. Also how would I define the area to which the movie clip can move?
Why Won't MC Chang X Position According To Another MC's Position?
Trying to make it so this movie clip moves it's x position when the "hero" mc is 10 or more ahead of it. But it only reacts if it's x position is at ahead of it at all. I want it to stop moving when it's closer than 10 pixels, but it only stops if it's x position is exactly past it. Is there anyway to change that?
I tried
code: onClipEvent (enterFrame) {
if (this._x <= (_root.hero._x + 10)) {
this._x += speed;
}
}
but that just moves the hero movieclip. It seems as though any variation of that coding doesn't help.
Thanks in advance if anyone can help.
If Empty
I am trying to interface with a mySQL database via php and I want to know if there is an empty($var) style command in flash actionscript.
I need to check if current_page and limit are set to anything if not set them to 1 and 0 respecively then call the php and pass it those variables.
I also need to do the same with some buttonss. The php returns 5 questions and answers, however if there are only 4 then the 5th button still has the question from the last time the script was called, I either need to set it to nothing or hide the button if the question is empty.
Thanks for any help.
Empty MC's
I'm having trouble w/ external SWF's functions once loaded into empty mc's. I have my main stage w/ an empty movie clip sitting on the stage. I load external parts of the site into this clip. Now I have a swf which is the photo section. within that section I a empty clip sitting on that stage. I have buttons on that stage which call upon the external swf's which hold the main photos. When I preview the main photo swf everything works fine. When I load that onto the main stage of the site, nothing works. here is the code I'm using within the main photo section. The rollovers are not working either. I know it's a bit more info I need to add but not sure how to go about it.
on (rollOver, dragOver){
_root.thumbs.heart.gotoAndPlay(2);
}
on (rollOut, dragOut){
_root.thumbs.heart.gotoAndPlay(9);
}
on(release){
unloadMovie("_root.photoloader")
loadMovie("mary.swf","_root.photoloader");
}
Really need some advice or a point in the right direction w/ this.
Empty MC's
Hey there,
I have a question about empty clips. My site seems to run a bit slower when an external clip is loaded into the empty mc. Is there a way to dump that from memory or free it up to run a bit faster once the clip is loaded?
Thanks
Empty MC Help
Hey guys,
Was wondering if you could look at these files and help me w/ this small problem. They are Flash2004 files, but I can save them as MX and upload if neccessary. My problem is, I"m trying to load the file called WEB into THEWORK file. If you open "The work" file and click on "web/layout' link, it does load, but the scroller dosent' work. Now I do have to load this into one more file which is the main, but if I can get this working I can figure the other out.
Thanks
www.artofdavesilva.com/files.zip
Empty Mc?
Help me please
If got 1 main.swf whit buttons in it,now i want to load external swf in de main.swf.
Now i know that y must bild a Empty mc but i don't know how to do that.
But i want a preloader in it for all the extern swf.
But first the empty mc How must i do that?
Please help.
Greats Desmond
Empty
Ignore this.. a double post.
Edited: 03/01/2007 at 10:43:11 AM by Ruth H
If Empty
I'm loading some info by an mysql database into flash. I created a variable for the web site
var Site:Object = this.Membre.Siteweb ... And It working perfectly. With that variable I'm able to load the web site and make some action. The only problem is there is not always a web site, when there is not a web site I would like to make an if/else and when the site is empty do thing but else thos some function (on release on a picture and on some text.)
How?
Thx
Xelaxa
Empty MC Help
Hey guys,
Was wondering if you could look at these files and help me w/ this small problem. They Flash2004 files, but I can save them as MX and upload if neccissary. My problem is, I"m trying to load the file called WEB into THEWORK file. If you open "The work" file and click on "web/layout' link, it does load, but the scroller dosent' work. Now I do have to load this into one more file which is the main, but if I can get this working I can figure the other out.
Thanks
www.artofdavesilva.com/files.zip
Empty MC's
Hey there,
I have a question about empty clips. My site seems to run a bit slower when an external clip is loaded into the empty mc. Is there a way to dump that from memory or free it up to run a bit faster once the clip is loaded?
Thanks
Empty MC's
Ok, since I have not gotten a response to my last question, let me rephrase. I'm having trouble w/ external SWF's functions once loaded into empty mc's.
Really need some advice or a point in the right direction w/ this.
Empty SWF?
Published SWF:s are empty..??
I can only see the content when I open the files direct from FlashMX and Explorer, but NOT by clicking on them..?
Anybody who could help me with this problem?
Moops
Empty Or Not
hi,
another problem... i have an mc that is at a position -x of the stage, inside that mc there are to dynamic text fields that retrive data form a xml file.
what i want to do is that the mc goes to a +x position if the text fields load the data.
the code to retrieve the xml:
Code:
var my_xml:XML = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success:Boolean) {
_root.mc_putos.rapaz_txt.text = my_xml.firstChild.firstChild.childNodes;
_root.mc_putos.rapariga_txt.text = my_xml.firstChild.firstChild.nextSibling.firstChild.nodeValue;
_root.targXmc_putos = 370;
};
my_xml.load("putos.xml");
if (rapaz_txt.text == "") {
trace("my_txt is empty");
} else {
trace("my_txt is NOT empty");
}
if (rapariga_txt.text == "") {
trace("my_txt is empty");
} else {
trace("my_txt is NOT empty");
}
as you can see i created a trace action to see if the text field is empty or not, but it always says that is empty, even if the text is there.
this is the code to move the mc
Code:
onClipEvent (load) {
_root.targXmc_putos = this._x;
_root.targYmc_putos = this._y;
}
onClipEvent (enterFrame) {
cXmc_putos = this._x;
cYmc_putos = this._y;
difXmc_putos = cXmc_putos-_root.targXmc_putos;
difYmc_putos = cYmc_putos-_root.targYmc_putos;
setProperty(this, _x, cXmc_putos-(difXmc_putos/3));
setProperty(this, _y, cYmc_putos-(difYmc_putos/3));
}
please help me!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
EMPTY MOVIECLIPS
I'm in trouble recovering properties from movie clips that are created with a variable target:
createEmptyMovieClip(target(expression), level)
It seems to be possible to set movie clips properties as they are created with this method, by using the method:
with(target(expression)){
setProperty(target(expression), property, value)
}
but not recovering them with a simple:
getProperty(target(expression), property)
giving the expression different values, of course.
Any idea? thanks for advanced
Empty Text Fx Swf's
flash mx
mac osx 10.2.1
if I make a text effect with the online flash typer, or a text fx actionscript, the swf plays and looks fine
import the swf into an fla, and all i get are 20 or so empty frames
what am i doing wrong?
...kind of new to most of this
thanks in advance
Mikeh
|