Dynamic Positioning For "no-stretch" Movies
Hi all,
I am trying to create a fly-in effect for a website splash-screen (horror)...I want to keep the images all same-size but stretch the background, this aint no thang really..here's the main beef:
My problem lies in initially positioning the element off-screen using actionscript. I have attached a listener to the stage which checks for resizing and I was hoping to use these values to position each movie clip and move them central. Unfortunately this isn't working as i wanted it..
Can anyone explain how to relate the stage width to the overall viewable area, provide a link or some portable code that will position an item off-stage, both right and left sides?
Many many thanks in advance..
james :)
Tek-Tips > Adobe(Macromedia): Flash Forum
Posted on: 12 Jun 06 13:24
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Hm.com Dynamic Stretch With Minimum Size
hey everyone,
i've been trying to figure out how the dynamic resizing works on http://www.hm.com/us
when the browser window is resized, the site maintains its aspect ratio, the navigation stays the same size, but the background image stretches to fit the browser window. the vertical portion of the background is trimmed based on the window's height, as it stretches to match the width which fills the window horizontally.
on top of all that, if the window is sized down to a certain point, the flash file stops downsizing and forces the browser window to create scroll bars to accommodate it.
they're using two frames in their html code, but i'm not totally sure what they're doing with them as i couldn't get the individual frames to load separately (cheeky).
anyone have an idea on how this effect is achieved?
thanks for your help in advance!
Edited: 03/26/2007 at 03:38:57 PM by ionic77
Positioning New Movies
Hi guys
I am using this code:
onClipEvent (load) {
for (i=1;i<_root.categories.length;i++){
_root.attachMovie("newCategoryButton","image_" + i + "_0",i);
setProperty ("image_" + i + "_0", _x, 60);
}
}
to create new movie clips in my movies. The thing is they all appear in the top left corner and I can't move them anywhere else. I have tried setProperty as above, image_1_0._x = 60 and have even tried writing a function inside the movie clip to move it.
How do I put it where I want it?
Thanks
Giles Roadnight
http://giles.roadnight.name
messenger: giles_roadnight@hotmail.com
ICQ: 81621370
Auto Stretch Text In Dynamic Field
Hi.
Does anyone know how I can tell Flash to make all the contents (text) of a dynamic text field stretch to fit the window, as well as shrink them if the window is too small?
I basically want to tell Flash: I have a SWF that is 400 x 200, which contains only one dynamic text field. Now make the text in that field (or the field itself) resize to maximize itself in the 400 x 200 area, no matter how many characters or lines it has.
is this possible? I've seen what appears to be this scenario on the front page headline of http://www.ESPN.com.
Thanks in advance for any suggestions!
Auto Stretch Dynamic TextBox Height
Hi,
How can I make a dynamic test box stretch in height to the ammount of copy that gets sucked in from the database?
Currently it just cuts of at the bottom of the box that I've manually pulled down.
This is probably something stupid, but I just can't find a sollution yet.
Thanks in advance
Positioning Loaded Movies?
Hi,
I was wondering if any1 could help me... basically when i load external .swf files into my main movie the positioning is all wrong!! It loads fine, but i want to load it into a particular part of the page.
Any help on how to do this would be appreciated
Positioning My Attached Movies?
Hi, trying to attach my movie 'transition' in the centre of my movie. done this before without probs but now i cant get it to move... wheres my code gone wrong?
on (press) {
this.attachMovie("transitions", "trans", 1);
trans._x = 97.3;
trans._y = 172.8;
}
thx for any help
lev
Positioning A Swf Movies With LoadMovie
Ok here is my problem.
I am trying to load a seperate swf into a playing movie. This swf is for a CDrom and the loaded movie contains my video. I can get the video to play, but not load in the position I want it to. Here is the code I am using on the button:
on (release){
loadMovie("video.swf", 1)_x41_y84;
}
Can anyone show me the correct format? THis is REALLY driving me nuts
Thanks everyone
JF
Help With Positioning Loaded Movies.
I have created a new symbol on a new layer, then I have added the load movie actionscript to load a movie that is in the same folder as the fla file. The moviel loads just fine but it positions itself at the top left side of the page, not where I have placed the symbol which it is replacing/playing in. How o how can I move the movie to the correct part of the page. I have been fiddling with it for hours.
Many thanks to those who answer
Voodoo
[F8] Duplicating Movies And Positioning
Hi, I'm looking for a solution to this problem.
I have a movie clip which is being loaded onto the stage, it uses xml data to display thumbnails. The xml file has 12 thumbnails, so the stage will have 12 duplicates of the container movie clip. I can get them displayed in a straight line along the x-axis however I need 3 rows of 4, and I can't make it work.
This is what I've got so far.
Quote:
myXML=new XML();
myXML.ignoreWhite=true;
myXML.onLoad=function(ok){
if (ok){
//process data
allData=this.firstChild.childNodes;
for(i=0;i<allData.length;i++){
newPiece=thumbHolder_mc.attachMovie('template','pi ece'+i,i);
newPiece._x=i*125
newPiece.heading_txt.text=allData[i].firstChild.firstChild
//trace(allData[i].firstChild.firstChild);
}
}else{
trace('can't find file');
}
}
myXML.load('xml/gallery1.xml');
newPiece._x=i*125 is the part which adds the movie clips in a straight line of 12 (i being 12 and 125 being the width) but I can't limit the x amount to 4 movie clips and start again, from 5-8 on a specified y value.
Any help would be great. Thanks.
Flash Movies And CSS Positioning
Is there any css tricks to get a flash movie to butt up tightly to the upper left hand corners? I can sort of get it to work in Netscape and Foxfire. IE is stubborn though. Has anyone done this before?
Thanks
Positioning Dulplcated Movies On A Loop?
I am using the code below to create a row of duplicated movies... I need to adapt this script to create a row again but 2 high ie movie numbers
1357....
2468....
or 1458...
2367...
PLEASE HELP ME!!!!
Cheers Oll
onClipEvent (load) {
// create 4 movie clips
for (i=1; i<=_root["seriesCount"]; ++i) {
// attach the movie clip
duplicateMovieClip (_root.home.pannel003.panel.portfolio.asp.host.mov ie, "movie"+i, +i);
// set its position
_root.home.pannel003.panel.portfolio.asp.host["movie"+i]._x = i*126;
_root.home.pannel003.panel.portfolio.asp.host["movie"+i]._y = 752;
Loading External Movies, Then Positioning Them?
Loading an external swf onto the movie is easy, yes? I was wondering if it is possible to move the position of the second swf while in the root of the movie?
Normally the second movie or movie that is being loaded, just plays reletive to where it was on its original movie.
Just curious if it is possible to move the position in the root via some actionscript or something and if so, how?
Thanks guys...
Dion
Positioning Loaded Jpegs Within Movies
I've loaded a jpg into my movie using loadMovieNum to place it on a layer. This works okay. However, it automatically appears in the top left hand corner of the movie. The script is attached to a button which calls up the image.
on (release) {
loadMovieNum("001.jpg",10);
}
Does anyone know if i can give the image an exact position within the movie at the time of loading?
Positioning Multiple Attached Movies.
Okay here is what i have so far. (it works)
this coding is places on frame 2of a movieclip and is played to frame 3 then stopped with the randomly loaded movie stored on frame 3 (might be useful info, or maybe not.)
//Makes "e" random number within 1 - 6.
e = Math.ceil(Math.random()*6);
//adds the randomly called movieclip and positions it to the screen.
adde1 = _root.attachMovie("enemy"+e,"enemy1",1);
adde1._x=280;
adde1._y=200;
what i am having problems with is trying to load more then 1 movieclip to the screen with different co-ordanants.
i have tried
//Makes "e" random number within 1 - 6.
e = Math.ceil(Math.random()*6);
//adds the randomly called movieclip and positions it to the screen.
adde1 = _root.attachMovie("enemy"+e,"enemy1",1);
adde1._x=280;
adde1._y=200;
adde2 = _root.attachMovie("enemy"+e,"enemy2",1);
adde2._x=300;
adde2._y=180;
adde3 = _root.attachMovie("enemy"+e,"enemy3",1);
adde3._x=320;
adde3._y=160;
but with that code only the 1 movieclip gets attached (the bottom 1) what is the problem ? how do i have flash read them seperately andposition them seperately
thank for any help.
Positioning Movies Inside Of A ScrollPane
Hi All,
This is my first posting so I hope it all makes sense.
I saw on a website a "zoom" feature for a movie clip inside of a ScrollPane.
On my movie I have a ScrollPane in the first frame of the main movie. Then I load my clip (clipa) into the scroll pane and everything works fine. I have created a zoom button (in the main movie) which goes to frame 2 of the main movie with a larger version of the imported clip named(clipa-mid) into the scroll pane. When I click this button the movie loads with scroll bars because of the size but...( now here's my question ) the imported movie (clipa-mid) is registed on the top left corner of the movie. I want it to be able to be loaded in the center of the movie.
Here is the link to the site where I saw this done.
http://www.shoptwelveoaks.com/IM/
Any help on this topic would be great.
Thanks
Eric
Positioning External Movies In Your Main Movie
How would you go about positioning a external movie (a preloader) that's smaller than your main movie, without loading it into a movieclip? Simply using code? Math? x/y coordinates?
Here's the deal:
I have a small preloader.swf about 150pxX25px that loads into my containerMovie.swf until my other external movies are fully loaded. But I'd like this preloader to load into the middle of the movie. Is there a simple way to do this?
Thanks, Matt
Here's the code I have to give you an idea of what I'm trying to do:
stop();
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myMCL.addListener(myListener);
//-----------------PRELOADER CODE----------------------\
myListener.onLoadProgress = function (target_mc, loadedBytes, totalBytes) {
_level50._visible = true;
var preloadPercent:Number = Math.round((loadedBytes / totalBytes) * 100);
_level50.preloader.gotoAndStop(preloadPercent);
}
myListener.onLoadComplete = function (target_mc) {
_level50._visible = false;
}
//-----------------/PRELOADER CODE----------------------\
//------------Main Movies Here-----------------------\
myMCL.loadClip ("preLoader.swf",50)
;
//------------Main Movies Here-----------------------\
Full Screen Flash Positioning Of Movies
hi does anyone know of a good tutorial which concentrates on placing movie clips at the edge of a full browser flash site?
I have seen it alot on sites.http://www.favouritewebsiteawards.com/ for example
I have tried it before but have used the on stage resize listener function. This caused problems when the site initially loads as it requires the size of the stage to change before operating. I have had feedback that on some peoples computers the function did not work when the site loaded but only when they resized their screen, even though I used the
Stage.scaleMode = "noScale";
on the first frames of the site.
I have been looking everywhere.
thanks
michael
Positioning Externally Loaded Movies In Flash 5
Hi, posted this previously to little avail....
I'm having problems, positioning movies that have been loaded in externally, I've looked at it over and over and still no joy, I'm using the following code:
loadMovieNum("externals/level1.swf", 2);
_level2._x = 500;
_level2._y = 500;
I gather I need to ensure the movie is loaded before I can position it - how does one check for this ?
I am still learning so it's all rather new.
Many thanks in advance...
tom
Positioning Externally Loaded Movies In Flash 5
Hi,
I'm having problems, positioning movies that have been loaded in externally, I've looked at it over and over and still no joy, I'm using the following code:
loadMovieNum("externals/level1.swf", 2);
_level2._x = 500;
_level2._y = 500;
Is this wrong ?
Many thanks in advance...
tom
Positioning Movies Within Other Movies
---positioning movies within other movies------
I used a program to convert a .mov file into a .swf file. My plan was to then insert that movie into a flash website.
The three things that went wrong are that the creater of the program incripted VID2SWF on the top of the movie, I can't edit the movie, and when i try to load the movie into my flash background i can't position it where i want to.
MC Positioning To Stage Borders In 100x100, Center Aligned Movies
I'm always using "100% x 100% noscale" settings while creating Flash sites. A few years ago I've learned how to position some movie clips to the stage borders. The only solution was to make "TL" movie align. But I like center align (don't ask why, I have some reasons). I tried to calculate right position with center align, but without success.
A few days ago I tried again and was surprised how simple the solution is. It's so simple that I don't believe no one uses it already, but I still haven't seen it anywhere.
This example is if you have movie clip 800x600 and 100x100 scene with center align.
PHP Code:
movie._y = Math.round((Stage.height/2-300)*-1);//topmovie._x = Math.round((Stage.width/2+400))-movieWidth;//rightmovie._y = Math.round((Stage.height/2+300))-movieHeight;//bottommovie._x = Math.round((Stage.width/2-400)*-1);//left
Dynamic Positioning Help
Here is what I have:
_root.createEmptyMovieClip("imageHolder"+f, 200+f);
_root.imageHolder+f._x=5 * f;
_root.imageHolder+f._y=100;
But Flash doesnt allow the '+f' being added onto the positioning since it isn't directly part of of the variable's name. What can I do?
I have Flash MX 2004
Dynamic Positioning
hi.
i have a calendar and it calculates the width of each row dynamically:
code:
numCols = 7 // 7 days in the week
columnWidth = _width/7;
very nice-nice. however, the rows aren't that easy because depending upon where the first day of the month falls, there could be either 4, 5, or 6 rows. currently, i hard code the values for the rows, i.e.:
code:
startThirdRow = 50;
tuesday_mc._y = startThirdRow
and when a new row starts, i do this:
code:
// If it's Saturday, Increment the Week Count
if (firstDay == 7) {
firstDay = 0;
startThiRowYPos += 25;
}
that's not going to cut it because i'm building a component and i need to program it so it can be resized by the end user.
any ideas? as always, any help is greatly appreciated.
thanks. fumeng.
Dynamic Positioning
how can i position a movieclip on the stage that has been dynamically loaded with a dynamic instance name?
[F8] Dynamic Positioning
Greetings,
I’m relatively new to action script so this may take a while. I am attempting to create a website which can be controlled via an external .txt file. I have all the Text, Images, and menu items being taken from a single .txt file and now I want to experiment with the dynamic positioning of say text boxes and loader components.
What I am aiming for is providing a set of CoOrds in a text file and having flash apply them to a text field or loader.
I know I am way out of my depth but if anyone could give me a few pointers or knows of an idiots tutorial, it would help me greatly.
Cheers,
Atomiser
Dynamic Positioning
Hi,
I have a problem with my xml gallery. I load each picture on a container and on the onEnterFrame of this container i'm waiting that the picture is loaded, i take the _width and _height and center the picture then a fadein effect. All is working great except that i can see the picture moving while the fadin. I tried everything i think but didn't find what to change to make it work properly.
Here's some of my code and a link to see what's happen :
http://adesign.tonsite.biz/xml_alerie/xml_galerie.swf
Code:
function attache_btn() {
//Create an array of the xml values with the function tableaux()
tableaux();
//Create a container for the buttons
_root.createEmptyMovieClip("thumb_mc", 1);
thumb_mc._x = 10;
thumb_mc._y = 10;
nb_ligne=3;
nb_colonne=3;
//attach the tooltip 'thumb_mc'
thumb_mc.attachMovie("texte","tooltip_mc",100,{_visible:false});
//attach 'container_image' on the scene
_root.attachMovie("container_image","container_mc",0,{_y:10,_x:120});
container_mc.preloader._visible=false;
thumb_mc.tooltip_mc.onEnterFrame = function() {
if (_global.x == 1) {
this._x = Math.round(_root._xmouse);
this._y = Math.round(_root._ymouse);
this._visible = true;
} else {
this._visible = false;
}
};
//attach les buttons inb the container
nb_images = images_xml.firstChild.childnodes.length;
for (i=0; i<nb_images; i++) {
thumb_mc.attachMovie("Btn", "Btn"+i, i, {_x:35*(i%nb_ligne), _y:35*Math.floor(i/nb_colonne)});
thumb_mc["Btn"+i].i=i;
thumb_mc["Btn"+i].j=tableau_url[i];
//Rollover
thumb_mc["Btn"+i].onRollOver=function(){
this.gotoAndPlay("over");
_global.x=1;
thumb_mc.tooltip_mc.caption.text=tableau_texte[this.i];
//Format tooltip
thumb_mc.tooltip_mc.caption.background=true;
thumb_mc.tooltip_mc.caption.backgroundColor="0xFFFFFF";
thumb_mc.tooltip_mc.caption.autoSize=true;
thumb_mc.tooltip_mc.caption.border=true;
thumb_mc.tooltip_mc.caption.bordercolor="0xCCCCCC";
}
//Rollout
thumb_mc["Btn"+i].onRollOut=function(){
this.gotoAndPlay("out");
_global.x=0;
}
//Release
thumb_mc["Btn"+i].onRelease=function(){
container_mc.container._alpha=0;
container_mc.container.loadmovie(this.j);
container_mc.onEnterFrame=function(){
//Preload the picture
charge=this.container.getBytesLoaded()
total=this.container.getBytesTotal()
rapport=Math.round((charge*100)/total);
if(charge==total){
this.preloader._visible=false;
this.preloader.barre._xscale=0;
//pos the picture in the center
largeur=(this._width/2)-(this.container._width/2);
hauteur=(this._height/2)-(this.container._height/2);
this.container._x=largeur;
this.container._y=hauteur;
this.container._visible=true;
}else{
this.preloader.barre._xscale=rapport;
trace(this.preloader.barre._xscale);
this.container._visible=false;
this.preloader._visible=true;
}
//fadein picture
this.container._alpha+=5;
if(this.container._alpha>=100){
this.container._alpha=100;
trace(this.container._alpha);
delete this.onEnterFrame;
}
};
}
//text on each button
thumb_mc["Btn"+i].texte=tableau_num[i];
}
}
Top Right Dynamic Positioning
Hey All,
how would you go about positioning a MC in the top right hand corner - a few pixels. And How to get it to stay even on Resize? to get it to stay in that corner so it moves with the screen resize??
Cheers,
Dynamic Positioning
I am using actionscript to place every thing on the flash dynamically. However, when I was finished I noticed a tiny little bug that I just can't fix. Whenever the stage.height is an even number one of the objects is misaligned by half a pixel. When ever the stage.height is odd it is perfect. See images below for what I mean.
Here is the related actionscript (called upon load and resize):
ActionScript Code:
left_object1._x = Stage.width / 2 - left_object1._width;left_object1._y = Stage.height / 2 - (left_object1._height / 2);right_object2._width = Stage.width / 2;right_object2._x = Stage.width / 2;right_object2._y = Stage.height / 2 - (right_object2._height / 2);
Object 1 is: 109px x 255px
Object 2 is: 1/2 stage width x 253px
Does anyone know how to fix this silly problem? I was thinking something to do with rounding down? But I don't know really. I would really appreciate the help!
Dynamic Positioning
Hi,
I have a problem with my xml gallery. I load each picture on a container and on the onEnterFrame of this container i'm waiting that the picture is loaded, i take the _width and _height and center the picture then a fadein effect. All is working great except that i can see the picture moving while the fadin. I tried everything i think but didn't find what to change to make it work properly.
Here's some of my code and a link to see what's happen :
http://adesign.tonsite.biz/xml_alerie/xml_galerie.swf
Code:
function attache_btn() {
//Create an array of the xml values with the function tableaux()
tableaux();
//Create a container for the buttons
_root.createEmptyMovieClip("thumb_mc", 1);
thumb_mc._x = 10;
thumb_mc._y = 10;
nb_ligne=3;
nb_colonne=3;
//attach the tooltip 'thumb_mc'
thumb_mc.attachMovie("texte","tooltip_mc",100,{_visible:false});
//attach 'container_image' on the scene
_root.attachMovie("container_image","container_mc",0,{_y:10,_x:120});
container_mc.preloader._visible=false;
thumb_mc.tooltip_mc.onEnterFrame = function() {
if (_global.x == 1) {
this._x = Math.round(_root._xmouse);
this._y = Math.round(_root._ymouse);
this._visible = true;
} else {
this._visible = false;
}
};
//attach les buttons inb the container
nb_images = images_xml.firstChild.childnodes.length;
for (i=0; i<nb_images; i++) {
thumb_mc.attachMovie("Btn", "Btn"+i, i, {_x:35*(i%nb_ligne), _y:35*Math.floor(i/nb_colonne)});
thumb_mc["Btn"+i].i=i;
thumb_mc["Btn"+i].j=tableau_url[i];
//Rollover
thumb_mc["Btn"+i].onRollOver=function(){
this.gotoAndPlay("over");
_global.x=1;
thumb_mc.tooltip_mc.caption.text=tableau_texte[this.i];
//Format tooltip
thumb_mc.tooltip_mc.caption.background=true;
thumb_mc.tooltip_mc.caption.backgroundColor="0xFFFFFF";
thumb_mc.tooltip_mc.caption.autoSize=true;
thumb_mc.tooltip_mc.caption.border=true;
thumb_mc.tooltip_mc.caption.bordercolor="0xCCCCCC";
}
//Rollout
thumb_mc["Btn"+i].onRollOut=function(){
this.gotoAndPlay("out");
_global.x=0;
}
//Release
thumb_mc["Btn"+i].onRelease=function(){
container_mc.container._alpha=0;
container_mc.container.loadmovie(this.j);
container_mc.onEnterFrame=function(){
//Preload the picture
charge=this.container.getBytesLoaded()
total=this.container.getBytesTotal()
rapport=Math.round((charge*100)/total);
if(charge==total){
this.preloader._visible=false;
this.preloader.barre._xscale=0;
//pos the picture in the center
largeur=(this._width/2)-(this.container._width/2);
hauteur=(this._height/2)-(this.container._height/2);
this.container._x=largeur;
this.container._y=hauteur;
this.container._visible=true;
}else{
this.preloader.barre._xscale=rapport;
trace(this.preloader.barre._xscale);
this.container._visible=false;
this.preloader._visible=true;
}
//fadein picture
this.container._alpha+=5;
if(this.container._alpha>=100){
this.container._alpha=100;
trace(this.container._alpha);
delete this.onEnterFrame;
}
};
}
//text on each button
thumb_mc["Btn"+i].texte=tableau_num[i];
}
}
Dynamic Positioning?
Hello,
I am working on a project and am in need of some help.
I know this is a simple issue, but I'm just running into walls.
I have a 5 nav buttons and a slider window. As you click on
one of the navs it's position is set and the slider moves either
right or left depending on the position of the button to the slider.
Now, that all works just fine except that my slider is moving
at slider._x = slider._x + (or -) 10
so that when it gets to the location it should stop at it jump to
ten on oneside (right) and then it jumps to the left on the other side.
I need to dynamically set the slider to slide and stop. I have tried
a hitTest but sometimes that doesn't work either and my slider
convulses. Does anyone have a possible solution for me that would make
this slide smooth fast and stop where it needs to reliably?
jay
Dynamic Text Positioning
Hello,
I have several text fields which gets dynamic value,
the length of the values can be different from one initialization to another.
how can I align all the text fields to each other, the size of the field is fixed ?
any idea of how to tackle this
thanks in advance
/monga.
Positioning Dynamic Jpegs
Greetings,
I am loading external jpegs into a flash mx file. No problem there, but they only seem to want to be positioned from the upper left corner. I would like to position them from the upper right corner instead so as to fit my movie correctly. Doesn't seem like the registration point can be changed. Any help would be greatly appreciated.
Thanks in advance.
Dynamic Text Box Positioning
Hi
i posted about this earlier but the thread seems to have dissappeared.
Im populating three dynamic text boxes with variables from a php script, and trying to get them to line up underneath each other dependent on how many lines of text is in each, i.e. box 2 sits just under box 1 irrespective of whether box 1 has 12 or 72 lines of text in it. each text box is in its own mc.
the action script:
/////set text box sizes to auto /////
_root.namemc.NAME.autoSize = true;
_root.studiedmc.STUDIED.autoSize= true;
_root.textmc.TEXT.autoSize= true;
///// load variables /////
var quotesVars = new LoadVars();
quotesVars.onLoad = function(ok) {
if (ok) {
studiedmc.STUDIED.text = quotesVars.STUDIED;
namemc.NAME.text = quotesVars.NAME;
textmc.TEXT.text = quotesVars.TEXT;
}
};
quotesVars.load("http://mydomain.uk/code/servers/quote.php");
///// position three movieclips containing textboxes at zero //////
setProperty (studiedmc, _y, 0);
setProperty (namemc, _y, 0);
setProperty (textmc, _y, 0);
//////get the height of the the 'name' movieclip//////
var nameheight = getProperty (namemc, _height);
////// and position 'studied' movieclip accordingly //////
setProperty (studiedmc, _y, nameheight);
/////get hieght of 'studied' movieclip /////
var studiedheight = getProperty (studiedmc, _height);
////// add the 2 together //////
var textpos = (studiedheight + nameheight);
/////and position text movieclip accordingly //////
setProperty (textmc, _y, textpos);
</actionscript>
it doesnt seem to make any difference how many lines are in each box, they always lie in the same position.
any pointers greatly appreciated.
thanks
ben
Dynamic Sizing And Positioning
Hi in ammendment to my previous post, i am trying to get this file to work and still can't! my aim is to get the bar that is clicked on to resize to 398px width and make the other bars move accordingly so they fit and they resize to 40px. a the moment i only have the code working to make the bars move. any help would be greatly appreciated!
(mx2004)
Dynamic Text Positioning
currently i am dynamically creating a text box within a dynamically created MC and using the tween class to manipulate there _xscale and _yscale properties.
because the the registration point is at 0,0 (top left), then it animates from scale 0-100 (x and y) rather than appearing to come from the centre, it appears to grow from the corner
how can i make it so the MC's registration point is centre on the text box?
Dynamic Navigation Positioning
Hi all,
I need some help.
I've setup a loop which runs and attaches buttons for a horizontal navigation, the button text is dynamic so the width of the button varies. I am checking the width of the text box and using this value to set the width of the button. This is all fine, the problem is with the positioning of the buttons. I don't want them to be equally spaced using something like xPos = i *50;
If button 01 is 50 wide and button 02 is 30 wide then button 02 would need to be positioned at 50 so it follows on from button 01. Then the 3rd button would be at 50+30 and so on. Hope this makes sense, it's a bit tricky to explain.
Here's my code
PHP Code:
for (i=0; i<clientInfo.length; i++) {
clientId = clientInfo[i][0];
clientName = clientInfo[i][1];
clientButtons = attachMovie("client_button", clientId, i+20);
clientButtons.clientTxt.text = clientName;
//Scale the button's width
clientButtons.clientTxt.autoSize = "left";
buttonXsize = clientButtons.clientTxt._width;
clientButtons.clientButtonHit._width = buttonXsize;
//Position the buttons
clientButtons._y = 150;
// this next bit is where i need help
clientButtons._x = 150*i;
}
}
Any help much appreciated
Thanks
Movieclip ._x & ._y Dynamic Positioning
I have a set of movie clips I need to position within the bounds of a circle with equal distances between each movie clip. Basically, I need to dynamically position movie clips like you would position the numbers on a clock but it would not be limited to just 12 as the number of movie clips changes.
I am loading my movies via attachMovie:
for(var i=0; i < 26; i++) {
this.attachMovie("mc", "mc" + i, this.getNextHighestDepth());
}
... and am stuck on how to set the x/y coordinates for what I need. Again, it would resemble a clock with 26 numbers and the clock would have a diameter of 130.
Any help would be greatly appreciated.
Dynamic Navigation Positioning
Hi all,
I need some help, it's pretty urgent. I don't normally state that but this time it really is
I've setup a loop which runs and attaches buttons for a horizontal navigation, the button text is dynamic so the width of the button varies. I am checking the width of the text box and using this value to set the width of the button. This is all fine, the problem is with the positioning of the buttons. I don't want them to be equally spaced using something like xPos = i *50;
If button 01 is 50 wide and button 02 is 30 wide then button 02 would need to be positioned at 50 so it follows on from button 01. Then the 3rd button would be at 50+30 and so on. Hope this makes sense, it's a bit tricky to explain.
Here's my code
ActionScript Code:
for (i=0; i<clientInfo.length; i++) {
clientId = clientInfo[i][0];
clientName = clientInfo[i][1];
clientButtons = attachMovie("client_button", clientId, i+20);
clientButtons.clientTxt.text = clientName;
//Scale the button's width
clientButtons.clientTxt.autoSize = "left";
buttonXsize = clientButtons.clientTxt._width;
clientButtons.clientButtonHit._width = buttonXsize;
//Position the buttons
clientButtons._y = 150;
// this next bit is where i need help
clientButtons._x = 150*i;
}
}
Any help very much appreciated.
Thanks
Positioning Dynamic Textboxes
Hi, I was hoping someone would have some advice on this. It's been driving me nuts all afternoon.
Basically I have 2 dynamic textboxes, both with the same variable name but different instance names (txt1 and txt2). For the design, I need the second box, which is slightly underneath the other, to have its x position half way along the text in the first box. I've tried writing txt2._x=txt1.width/2, but this isn't working, and in fact when I use trace the width of the first textbox is coming back as 1.5, regardless of whether the text input is 4 letters or 100 letters long.
Does anyone have any ideas?
Many thanks.
Dynamic Positioning Of XML Text
Hi!
I have XML text I load into different MCs with attachMovie. For each XML node I create a new MC with 3 text fields and place it on stage.
I need to (but can't!!) place each MC under the previous one, and _y will depend on the previous MCs height (amount of text). It is the third text field (txt3) that would have varying height.
for (var i = 0; i<news.length; i++) {
item = Container.attachMovie("newi", "newi"+i, i);
item.txt1 =this.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue;
item.txt2= this.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue;
item.txt3 = this.firstChild.childNodes[i].childNodes[2].firstChild.nodeValue;
item._x = 80;
item._y = ???????;
}
Does this make any sense? Any help would be much much appreciated!!
Thanks in advance!
Trouble With Dynamic Positioning _y
I’m stumped with this maybe someone here can help.
I have a list of collapsible move clips.
When anyone of the clips is closed or opened the rest or the clips in the list react by changing position.
I had this running with and on enter frame event. But that was a memory hog when too many items were in the list.
So what I want to do is this
When any clip is closed or opened it triggers this function
Code:
function resetY() {
for (var i = order; i>=many; i++) {
this.onEnterFrame = function() {
_y = previousitem._y+previousitem.box._height;
roundB4me = Math.ceil(previousitem._y+previousitem.box._height);
roundme = Math.ceil(_y);
if (roundB4me == roundme) {
delete this.onEnterFrame;
}
}
}
My problem is with placing this clip on clips in the _parent.
So what I want is more like this:
Code:
function resetY() {
for (var i = order; i>=many; i++) {
_parent[nextClip+i]onEnterFrame = function() {
_y = previousitem._y+previousitem.box._height;
roundB4me = Math.ceil(previousitem._y+previousitem.box._height);
roundme = Math.ceil(_y);
if (roundB4me == roundme) {
delete this.onEnterFrame;
}
}
}
But I cant use: _parent[nextClip+i]onEnterFrame = function() {
Can any one help me out with this?
Thanks for any help!
Positioning Dynamic Images
Hello,
This is my first but probably not last time that I will be asking a question.
I am creating a fully dynamic XML based flash site.
here is a sample of some of my code:
myXML = new XML();
myXML.ignoreWhite = true;
myXML.load("gallery.xml");
myXML.onLoad = function() {
numimages = this.firstChild.childNodes.length
logospacing = 70
spacing =90;
for (i=0; i<numimages; i++) {
loader._x = 250;
loader._y = 220;
title_txt._x = 250;
title_txt._y = 420;
logos._x = 25;
trace (logos._x)
logos._y = 25;
picHolder = this.firstChild.childNodes[i];
this.logoHolder = _root.logos.createEmptyMovieClip("logo"+i, i);
this.logoHolder._x = i*logospacing;
this.logoHolder.logo = picHolder.attributes.logo;
this.logoHolder.campain = picHolder.attributes.campain;
this.logoLoader = this.logoHolder.createEmptyMovieClip("logo_image"+ i, i);
var twlm:Tween = new Tween(sep1, "_y", Regular.easeOut, 0, 92, 1, true);
var twlm:Tween = new Tween(logomask, "_alpha", Regular.easeInOut, 100, 0, 1, true);
var twlh:Tween = new Tween(logos, "_y", Regular.easeOut, -75,25, 1, true);
this.logoLoader.loadMovie(picHolder.attributes.log o);
My question is how do I position the created logoHolder with all the logos that are going to be dynamically loaded by the XML to be centered on the stage via _x.
I know that the positioning of the logoHolder can be positioned by setting the logos._x to a value and it will put it on the stage along the x axis.
What I would really like is for the logos to either be centered on the stage or have them spread out accross the stage evenly but staying within the boundaries of the stage.
If this is confusing I am sorry. But you can check out what I have done so far by going to HERE and what i mean by the logos being spaced. The logos I want spaced properly are the Puma logos.
Thnks in advance for your help.
Dynamic Positioning Problem (Please Help)
Okay I am making a drop-up menu (drop-down that goes up) and am having major problems with getting the child links to be placed in the correct area.
I have attached the fla so you can see what it is doing. I need to know what I am doing wrong and why it is positioning the child items incorrectly and scattered. I have also attached the xml file if you want to have that as well.
What I am needing it to do is simply take each parent and place the child links direcly under it.
Any help would be greatly appreciated.
Movieclip ._x & ._y Dynamic Positioning
I have a set of movie clips I need to position within the bounds of a circle with equal distances between each movie clip. Basically, I need to dynamically position movie clips like you would position the numbers on a clock but it would not be limited to just 12 as the number of movie clips changes.
I am loading my movies via attachMovie:
for(var i=0; i < 26; i++) {
this.attachMovie("mc", "mc" + i, this.getNextHighestDepth());
}
... and am stuck on how to set the x/y coordinates for what I need. Again, it would resemble a clock with 26 numbers and the clock would have a diameter of 130.
Any help would be greatly appreciated.
Dynamic Positioning Of XML Text
Hi!
I have XML text I load into different MCs with attachMovie. For each XML node I create a new MC with 3 text fields and place it on stage.
I need to (but can't!!) place each MC under the previous one, and _y will depend on the previous MCs height (amount of text). It is the third text field (txt3) that would have varying height.
for (var i = 0; i<news.length; i++) {
item = Container.attachMovie("newi", "newi"+i, i);
item.txt1 =this.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue;
item.txt2= this.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue;
item.txt3 = this.firstChild.childNodes[i].childNodes[2].firstChild.nodeValue;
item._x = 80;
item._y = ???????;
}
Does this make any sense? Any help would be much much appreciated!!
Thanks in advance!
Positioning Dynamic Movieclip Over Another
I am working with this script and would like the larger images to display over the thumbnails . I am having trouble positioning it over it's thumbnail?
I couldn't figure it out. Any guidance?
Any help is appreciated.
I only posted what I think is the neceesary code... if you need more, just let me know.
Code:
var thumbHolder : MovieClip = this.createEmptyMovieClip("holder_mc", this.getNextHighestDepth()); // movie clip that holds all the thumbnails
var mc : MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth()); // mc for the loaded images, that will show up when you click something
var thumb : MovieClip; // movie clip that holds the movie clip that the thumb will be loaded into
var button : MovieClip; // movie clip that the thumb will be loaded into
// function requires 2 parameters, the url of the thumb, and movie clip we need to load the thumb into
function loadThumb(path_url:String, mc:MovieClip) {
mc.loadMovie(path_url); // load the thumb into the movie clip
temp_mc = _root.createEmptyMovieClip("temp_mc", _root.getNextHighestDepth()); // create a temporary movie clip to handle our onEnterFrame event
temp_mc.onEnterFrame = function() {
l = mc.getBytesLoaded(); // get the bytes loaded
t = mc.getBytesTotal(); // get the bytes total
percent = l/t; // get the percent between the two
if (percent>=1) { // if the percent is greater to our equal to 1, this means the thumbnail is loaded
curr++;
if(curr <= tN-1) {
loadThumb(path_a[curr], mA[curr]);
thumbText.text = (curr+1)+" / "+tN+" THUMBNAILS LOADED";
}
else {
thumbText.text = (curr--)+" / "+tN+" THUMBNAILS LOADED";
animate(tA[currAn], xRA[currAn], xPA[currAn], yRA[currAn], yPA[currAn], r_w_h_array[currAn], blurArray[currAn]);
}// for a little extra flare, lets animate the thumb into the grid from a random position
// set up the text properly
temp_mc.removeMovieClip(); // delete the onEnterFrame event
}
};
}
[as1] Issues With Dynamic Positioning
What I want to do is simply place some MCs in a certain area after they have been created with the 'attachMovie' script. Here is my code, am I barking up the wrong tree?
ActionScript Code:
//---functions---
//
function setPos(clipName, xPos, Ypos) {
clipName._x = xPos;
clipName._y = yPos;
}
//---button code---
//
tb1_btn.onRelease = function() {
count++;
attachMovie("playerClip", "pClip"+count+"_mc", count);
attachMovie("itemClip", "iClip"+count+"_mc", count+10);
setPos("pClip"+count+"_mc", 400, 400);
};
Dynamic Positioning / Textfield / Autosize
ok, basicily what im trying to do is convert some string to array, and populate it to separate dynamic textfields, so I will be able to make every word clickable. No problem with that. What im strugling with is positioning a textfields like they are layout in a normal textBox. For some reason it's behaves very funny unless I change the autosize to "right" but then im running into trouble when spliting a text to few lines instead of having a very long one. (look commented field)
hopefuly someone can understand what my problem is. attache *FLA might be helpful.
Please help
Thank you
/M
code:
str = "at some point you may have to be a flash-db member to use is the web service we are invoking in this case"
var myWords = [];
myWords = str.split(" ");
for (var i = 0; i < myWords.length; i++) {
_root.holder.attachMovie("textField_mc","word_"+i, 100+i);
var word = _root.holder["word_"+i];
if (i != 0) {
var previousWord = _root.holder["word_"+(i-1)]
var previousWordWidth = previousWord._width
} else {
var previousWord= 0;
var previousWordWidth = 0;
}
word.label.autoSize = true;
word.label.text = myWords[i];
var w = word._width;
word._x = previousWord._x + w
trace(word._x)
//if (word._x > 200) {
//word._y +=20
//}
}
|