Depth; MCs And Lines Created W/ A.S.
I have a movie clip on the _root level, and in the first frame of the main timeline's i have the code:
_root.createEmptyMovieClip( "line", 0 ); with ( _root.line ) { lineStyle( 20, 0xFFFFFF, 100 ); //blah blah; stuff to make a line }
no matter what i change the depth parameter to in the movieclip-creating function, it always appears OVER the MC, but i want it under the MC. Suggestions?
FlashKit > Flash Help > Flash ActionScript
Posted on: 10-03-2005, 05:24 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
New Lines In Email Created In MX
My movie opens an email window with the users email client. They have already entered their details and some other data is pulled from the movie and entered into the email.
I can't seem to create newlines or carriage returns in the email, so all the data (name, address, ph, email) just wraps on one line, eg.
Name: John SmithEmail: john.smith@web.comPh: 6546 5646Postal Address: 87 Eighty seventh StLambodiaRufus 1111
Inserting newline between variables doesn't do anything.
Sample file attached.
New Lines In Email Created In MX
My movie opens an email window with the users email client. They have already entered their details and some other data is pulled from the movie and entered into the email.
I can't seem to create newlines or carriage returns in the email, so all the data (name, address, ph, email) just wraps on one line, eg.
Name: John SmithEmail: john.smith@web.comPh: 6546 5646Postal Address: 87 Eighty seventh StLambodiaRufus 1111
Inserting newline between variables doesn't do anything.
Sample file attached.
Removing Lines Created With LineTo()
I am using the lineTo() command. I am storing the coordinates in arrays as they are created. I also have an undo bttn that steps back throught the arrays drawing a white line over that drawn. This is ok till I have I it undoes over a 'more previous' line that I want to keep!!
Is their a command or a way to delete the line??
I thought about creating each linr in a new MC so I could delete the MC but how would it find the end of the prvious line???
Any help would be welcome
Cheers
Ol
Shape Tween Between Dynamically Created Lines
Is there a way to do a shape tween between two lines both created with the drawing methods. I want to be able to draw a begining line with the drawing method and an ending line with the drawing method and then have a tween between the two. Is this possible?
Fill Rectangles That Have Been Created By Attaced Lines
Hello!
I have asked this question in actionscript.org, but didn´t get any answers. I hope I have more luck here in Kirupa.
I have a fla wher you in a rectangle can put in columns and rows by clicking buttons. Now I want that if you click in one or the smaller rectangels created by the columns and rows, this rectangle shal be filled with a color. I also want to know how many of the rectangles are filled.
The meaning is that the user shal visualize a fraction and the as shal be able to know if it´s right. Is this possible?
I attach the fla.
Lines Visible On Interactive Cube Created
Hi all,
i have created a cube, and its suppose to rotate 180 degrees in each click.
i have manged to do this, however, there are lines that appear to cut across the bitmap on my cube. Any way i can remove these lines?
i have used InteractiveMovieAssetMaterial for the cube.
when i change it to a MovieAssetMaterial, the line disappears, but of course i lose my event listener.
im using AS3.0 and papervision 1.7
Pls help.
Thanks!
Dynamically Created Movie Clip Depth Issue
I am creating empty movie clips with a for loop, which then have a jpeg loaded into them. In relation to _root, these clips are being created in "_root.frame.scroller". Scroller is a movie clip on the stage, but with nothing in it, except the script.
The result on the stage is a movie clip in a movie clip in a movie clip (i.e. _root.frame.scroller.DYNAMICALLY GENERATED MC.)
The issue is that the event handling (onRollOver) isn't working. No action, no hand cursor, no nothing -- like it's not even there. So I think it's a depth issue, but I'm stuck.
Here's the code, which exists at frame1 of the MC "scroller'.
ActionScript Code:
totalimages = 5;
for (i=0; i<=totalimages; i++) {
img = "img"+i;
this.createEmptyMovieClip(img, i);
this[img].loadMovie("pic_"+i+".jpg");
this[img]._xscale = 18;
this[img]._yscale = 18;
this[img]._x = -82;
this[img]._y = (i*120)-290;
this[img]._alpha = 75;
this[img].onRollOver = function () {
this._alpha = 20;
}
}
I recognize it may be easier if you could see the FLA, but I cannot provide it. Sorry about that.
Thanks in advance.
Lines Created With LineTo Disappear When Timeline Element Is Placed
Hello-
I am new to serious actionscripting and new to the forums. On a side note... I am enjoying actionscript programming very much (a nice departure from Lingo.. which I am glad to be away from finally) and look forward to participating in this forum.
I am creating a movie with nodes that branch out from a parent node (using a movieclip named ball). When I use attachMovie() and place multiple nodes on the screen and draw lines between them, I have no problems. Recently I have added a background image, which I made a movie symbol, into the timeline. Now the nodes still show up, move the way they should, but the lines are gone. I dont know if this is a depth issue, or a timeline vs. attachMovie problem (I've tried both placing the movie in the timeline and using actionscript to attach it with both positive and negative depths)... anyone encounter this before? Any clues would be greatly appreciated. Thanks!
-Eric
Dotted Lines As Outline For Dynamically Created Shapes?
Hey all, I'm building a site whose flat, vector shapes need an outline of a dotted line.
The majority of these shapes are simply rectangles with rounded corners. All are created dynamically.
I could do each shape's lines by hand and attach them, but I'd much rather use a script. Anyone have any suggestions? :) I could use a good jump-start on tackling this.
Thanks in advance -
andy
Depth Issue With Dynamically Created Textboxes And Ungrouped/non-symbol Objects
wow that was a mouthful...
anyway...
im building a full as anything text-typing-component... easily modified and adapted etc...one problem however... (well at the moment there are several niggling little problems but hey! lol)
i came across a depth issue in testing.... its a little peculiar so you will have to bear with me...
i have 2 layers, called typer layer and plain layer... on the plain layer i have drawn out a shape... like a circle for instance....
if plain layer is on top of typer layer everything works fine.
if plain layer is below typer layer the typer does not type.... it doesnt even show up....
at present the dynamically created text field into which the typing text will be put into has a depth equivalent to that of a guide inside the component (just a plain mc used for determining sizes etc nothing special) +1 i added 1 to its current depth because if i dont i only seem to get EITHER the circle OR the typer.... whereas if i add 1, i get EITHER the typer AND the circle OR just the circle...
but this doesnt make sense does it? i mean if the typer layer is on top then it has a higher depth (ie. closer to zero as depths are currently in the negatives still ) so if i add 1 it shouldnt conflict with anything and i should get it typing and displaying the circle surely?
and if it is below then the circle has a higher depth so in this respect if the typer wouldnt work when it is on the bottom i could understand this as the depths would be conflicting and as such the dynamically created text field couldnt be created in the first place because the depth level is already occupied.... im not entirely sure if that would be true but regardless, the reverse is happening!
what is truly bamboozling me though is that if i convert the circle into a movieclip everything works fine even if they are on the same layer.... like it should....
can anybody help?
if you dont understand what im struggling to ask here, please ask and i will post the beta typer here and then walk you through the problem....
ANY help/input is welcome because i really am stumped....
Prophet.
Depth Issue With Dynamically Created Textboxes And Ungrouped/non-symbol Objects
wow that was a mouthful...
anyway...
im building a full as anything text-typing-component... easily modified and adapted etc...one problem however... (well at the moment there are several niggling little problems but hey! lol)
i came across a depth issue in testing.... its a little peculiar so you will have to bear with me...
i have 2 layers, called typer layer and plain layer... on the plain layer i have drawn out a shape... like a circle for instance....
if plain layer is on top of typer layer everything works fine.
if plain layer is below typer layer the typer does not type.... it doesnt even show up....
at present the dynamically created text field into which the typing text will be put into has a depth equivalent to that of a guide inside the component (just a plain mc used for determining sizes etc nothing special) +1 i added 1 to its current depth because if i dont i only seem to get EITHER the circle OR the typer.... whereas if i add 1, i get EITHER the typer AND the circle OR just the circle...
but this doesnt make sense does it? i mean if the typer layer is on top then it has a higher depth (ie. closer to zero as depths are currently in the negatives still ) so if i add 1 it shouldnt conflict with anything and i should get it typing and displaying the circle surely?
and if it is below then the circle has a higher depth so in this respect if the typer wouldnt work when it is on the bottom i could understand this as the depths would be conflicting and as such the dynamically created text field couldnt be created in the first place because the depth level is already occupied.... im not entirely sure if that would be true but regardless, the reverse is happening!
what is truly bamboozling me though is that if i convert the circle into a movieclip everything works fine even if they are on the same layer.... like it should....
can anybody help?
if you dont understand what im struggling to ask here, please ask and i will post the beta typer here and then walk you through the problem....
ANY help/input is welcome because i really am stumped....
Prophet.
Problem About Depth Of Objects..(swap Depth) Plse.help
umph..hello i'm nameg sir
i'm trying to do dragging project. drag isomatric object in small room(isomatric view too) for test installation..(so i necessary have foreground objects,background objects ..u know)
now i can drag many objs. in same movie when i press it , by i use swap depth command (for see it above other)and drag it around sometime it works...but sometime it don't!...
1..... some obj. automatic swap its depth! when i release other one....i don't know why
2. some time i dup. new obj. to drag and it del some old obj. that call before
ps. i use swap code from this site tutorial ...s.a.Drag & Drop / Swap DepthsAuthor by : estudioworks
thank u so muchhhhhhhhhhhhh
How To Find Number Of Lines Of Dynamic Text...and How Many Lines In Textfield
is there any way of finding out how many characters will fit in a dynamic textfield?
I have a textfield that is dynamically loaded with text. Sometimes the text is long and i need scroll buttons, but when the text is short i would like not display the scroll buttons.
How can i figure out if text is short enough not to display the scroll buttons?
oh..to make it even more complicated; the font of the text is not always the same. I use textformatting to display header-like lines in the textfield.
Bad Images - Straight Lines Are Jagged Lines - Why?
Hello -
Wondering if anyone had a solution --- I have some images for a portfolio - almost all of them have a diagonal line that's supposed to look straight, and in flash it's looking jagged and wiggly.
I began with 300 dpi images - saved them to the proper size, no compression, saved PNG's, then imported to Flash with lossless (jpg,png) setting, created Graphic Symbol with all graphic information in the upper left quadrant, and it is in an even space on the stage (no 113.4, but 113.0)....
I did a lot of research to make sure I got the best quality images & have taken all of these steps and it's still coming out crappy....
Any ideas? Much appreciated...
Question About Depth And Highest Depth
Hello hello
I am learning AS and am now at the depth story.
I have questions about it : when I create an empty mc, where different swfs will load in ( loaded on main stage by several movie clips) is it interesting to use the getNextHighestDepth command ??
Thank you action scripters !!!
Some Problems Drawing Lines Over Other Lines...
Hi.
I'm designing a character for a movie I'm gonna make, but I'm having some trouble. I recently decided to change the colors of the lines I used, so I switched them around a bit to match the fills but some of the lines I changed the color of now overlap the lines that are supposed to be in front. I tried to draw the 'good' color over them again but at the moment I release the button the lines I draw disappear again and the others overlap them. Any help? I'm using mx 2004.
Thanks in advance
Lines, Lines, Lines....and Their Movement...
How do i make a line to move, grow, shrink, follow a path...i thought about masking but i believe there must be an easier way of doing it via actionscript...am i right?
please help...
Thanx a lot for your time...
:eek:
Draw Lines By Mouse Drag And Erase Same Lines By Mouse Click.
Put the following script on frame ..
var i=0;
var sxcord;
var sycord;
var excord;
var eycord;
onMouseDown=function(){
i++;
sxcord=_xmouse;
sycord=_ymouse;
createEmptyMovieClip("temp_mc", 20);
onMouseMove=function()
{
temp_mc.clear();
temp_mc.lineStyle(1, 0xff0000);
temp_mc.moveTo(sxcord, sycord);
temp_mc.lineTo(_xmouse, _ymouse);
temp_mc.lineStyle(6, 65280);
temp_mc.lineTo(_xmouse + 0.500000, _ymouse);
temp_mc.moveTo(sxcord, sycord);
temp_mc.lineTo(sxcord + 0.500000, sycord);
}
}
onMouseUp=function(){
temp_mc.clear();
onMouseMove=null;
excord=_xmouse;
eycord=_ymouse;
createEmptyMovieClip("line"+i, i)
with (eval("line"+i)){
lineStyle (1, 0x0093DD, 100); // this is the colour of the final line.
moveTo (sxcord, sycord);
lineTo (excord, eycord);
endFill();}
eval("line"+i).onPress=function(){
trace(this._name)
removeMovieClip(this._name)
}
}
//++++++++++++++++++++++++++++++++++++++++++++++++++ +=
Enjoy !!!
Z-Depth
on my site I have content that appears in windows.
Each content window, (itself a mc) is on a different layer, on the timeline.
Is there a way of bringing a movie to the front, (ie by clicking on a button) using actionscript...I have seen the z-depth command but aint sure how to implement it?
Any ideas anyone?
Cheers - Check my site if you don't fully get what I mean....http://www.beseku.co.uk
Set DEPTH
is it possible to change the depth of a (dublicated)movieClip with a variable? I need this for a (pseudo) 3d engine!
peter
Depth
ok going to try this a diffrent way. I am going to preload 10 swf into difrent levels one on top of the other. the top one being blank so nothing shows. now I have 10 buttons in another swf on the right side that are loaded in there own level so the always show. now how to I get the first 10 movies to swap depth, I read what I could on macromedia and just could not make sence out of it.
Fl Depth
I have button that when clicked it makes a mc move back into the screen using the fl perceptive code which works but what I want is when you roll off the button for it to come back to its orignal scale and position .
on the button I have
on rollOver _root.acive =true; and rollOut _root.active=false[code]
onClipEvent (load) {
fl=150;
x=_x;
y=_y;
z=0;
spd=5;
}
onClipEvent (enterFrame) {
if ( _root.active ) {
scale=fl/(fl+z);
_x=x*scale;
_y=y*scale;
_xscale=_yscale=scale*56.4;
z+=spd;
if (z>400) {
z=400;
} else if (!_root.active) {
z-=spd;
[Edited by ericflash on 03-10-2002 at 08:53 PM]
Depth ?
can somebody please explane this depth thing to me cause i've herd of it but i really don't know what it does and how to use it....ect .
Depth.....
I am trying to have a gun that moves from side to side with Key.LEFT and Key.RIGHT.
and when you press spacebar it attaches a movie of a bullet moving forward
I am not worried yet about all the hitTest and enemys
But there is one problem, i don't know how to make all the bullets stay on the screen.
It sets them at one depth and then if you shoot again it will take away the last bullet, because it sets it at thesame depth.
doe any one have a solution¿?¿
Please help!
Depth
Does anybody know how to change depth property in movie clips?
Thanks.
Depth
hi there!
can anyone tell me how to change the depth of a loaded movie?i can't put it behind the content of the original one!
thanx!
Depth
Hello!
Is it posible in flash to make one mc appear over another even that they are in the same layer a _depth or _z something like that?
Depth.....
How would I go about making a MC in _level0 be above _level2
I sthere a way that a MC on the main time line can be higher than a SWF with
code:
loadMovieNum("contact.swf",2)
Depth
Ok, i have some buttons and movieclips, when you press a button i need it to bring it's corosponding movieclip to the front of the rest...
anyone?
-Stwelin
Depth
If i have and object, and I want its depth to be _parent.mc's depth - 1, how would I actionscript it on MX?
Im thinking like
this._depth = _parent.mc._depth-1
but it's not working. how's it meant to work?
Please remember i'm using MX pro 2004, and I will be truly thankful if you provide me the answer.
Depth
If i have and object, and I want its depth to be _parent.mc's depth - 1, how would I actionscript it on MX?
Im thinking like
this._depth = _parent.mc._depth-1
but it's not working. how's it meant to work?
Please remember i'm using MX professional 2004, and I will be truly thankful if you provide me the answer.
Depth?
Hi, after i have duplicated a MC, i want its depth to be less than that of my cursor?? how can i do this??
Depth
Is there a code in actionscript (i'm using Actionscript 2.0, Mx Pro 2004) which tells a movie clip to arrange itself under another mc on _level0, without swapping?
Please try, Ryan.
Set Depth
Hi, I attach a movie clips when movie is running but i want it behind my top layer 'tree'. I want it in the layer 'App'. I tried putting App in quotaion marks in the depth bit and i tried it without quuotaion marks like so
this.attachMovie("Apple","Apple_mc" + AppNum,"App")
Dont work.
How do i do it?
Thx
Help With Depth
How do you change the depth of an object already on the scene?
Get Depth?
i want to search a specific depth, and have it return the name of the movieclip there, i know there is a class that does this, but cant remember its name
Depth
what do i need to to to get a MC on my stage to sit above my circlemc which is using:
this.attachMovie("circle", "circle"+count, 10000+count,{_x:210, _y:250,_xscale:100, _yscale:100});
iv'e tried this:
this.mainBut.getNextHighestDepth();
but no luck
rat
[F8] How Is This Done? 2D, But With Depth...
Yes I know that makes it 3D, but what I'm looking for are flat levels at different depths. So maybe you click on one character and it zooms in and the other levels move accordingly? It could be thought of as paper dolls on toothpicks in a diorama. I'm not sure what to call it - check the example for my ad hoc version 1.
What I want is to move around, but always from the front, in a convincing way, as different characters are clicked. My question is how would I mathematically get the various MC's locations and scales? My best guesses look like just that, guesses...
Thanks!
Depth From AS2 To AS3.
I have been trying to do depth sorting for my MMORPG in Flash AS3. I saw this on Kirupa for Depth Sorting: http://www.kirupa.com/developer/isom...th_sorting.htm, but it seems to be AS2, and I already tried that method the same way in AS3. It doesn't work. What would I need to do to switch this method into AS3? In AS3, the max depth is the number of children, but I think there may be a way around. Anyone know how to fix this? Thanks in advance.
[F8] I'm A Little Out Of My Depth...
Hello, o' noble and sagacious ones;
i recently put up a site at creativelicensedesign.com that is flash based. when i test it on the computer, its fast like anything. but when i go to the site, its really slow. i am aware of the concept of a preloader but i havent the faintest clue what to do about it. any suggestions?
Thanks!
Berish
Can't Set Depth
Hello,
I was trying to remove a movieclip with no luck. I figured it could only be because there was no depth which turn out to be the case. I have tried to manually set the depth and cannot. I have 6 items attached in total and 2 of them cannot be removed or have depths defined for them.
For example...
Code:
subNav = survey_mc.attachMovie("SubNavSet","SubNavSet", survey_mc.getNextHighestDepth(),{_x:13, _y:558});
mainNav = survey_mc.attachMovie("MainNavigation","MainNavigation", survey_mc.getNextHighestDepth(),{_x:0, _y:260});
trace(subNav.getDepth()); //traces undefined
trace(mySlideViewer.getDepth());//traces 7
and
Code:
subNav = survey_mc.attachMovie("SubNavSet","SubNavSet", 2000,{_x:13, _y:558});
mainNav = survey_mc.attachMovie("MainNavigation","MainNavigation", survey_mc.getNextHighestDepth(),{_x:0, _y:260});
trace(subNav.getDepth()); //traces undefined
trace(mySlideViewer.getDepth());//traces 2001
does anyone know why this is happening and how to fix it?
thanks
Depth
I have a serious question about the getNextHighestDepth.
I am using the attach movie method to place some items on the stage, but it seems to be over lapping. Sometimes its in the right place and other times its missing?? Not too sure what's the problem here.
Example:
Code:
this.createEmptyMovieClip("emptyMC", this.getNextHighestDepth());
emptyMC.attachMovie("shapes", "name_shape, emptyMC.getNextHighestDepth(), {_x:329, _y:159});
}
emptyMC.attachMovie("letters", "alphabets", emptyMC.getNextHighestDepth(), {_x:327, _y:163});
}
Thanks
Depth From AS2 To AS3.
I have been trying to do depth sorting for my MMORPG in Flash AS3(Yes, I posted an earlier post, but I found more information and my question changed ultimately). I saw this on Kirupa for Depth Sorting: http://www.kirupa.com/developer/isom...th_sorting.htm, but it seems to be AS2, and I already tried that method the same way in AS3. It doesn't work. What would I need to do to switch this method into AS3? In AS3, the max depth is the number of children, but I think there may be a way around. Anyone know how to fix this? Thanks in advance.
Set Depth?
I have a deck of cards from 1-5 that are overlapping each other. When you click on one it enlarges and using swapDepth come to the front. When I close the card it goes back to it original state but is now on top of the other cards.
Is there a way that you can set depth? I want cards 1-5 to be at depths of 1-5 so when I close my card I can define what depth I want my card to return to.
Thanks for any help
|