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




Dynamic Positioning Kills A Timeline Tween? (CS3)



Hi, I'm working on a banner ad project where we're trying to send dynamic variables from one of our servers to position a movieclip that simply slides in from offstage and then does a little bounce.

My AS2 frame script at the beginning of the tween sets the _x and _y properties of the clip successfully. But that seems to destroy all the movement of the tween. In other words, when I set those two positioning properties on the clip, it just sits there and no longer slides in or bounces.

I've tried a lot of different values, but they all seem to kill the movement of the tween. Any constructive ideas would be appreciated, thanks!



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 01-20-2009, 05:12 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

AS2 - Dynamic Positioning Kills A Timeline Tween?
Hi, I'm working on a banner ad project where we're trying to send dynamic variables from one of our servers to position a movieclip that simply slides in from offstage and then does a little bounce.

My AS2 frame script at the beginning of the tween sets the _x and _y properties of the clip successfully. But that seems to destroy all the movement of the tween. In other words, when I set those two positioning properties on the clip, it just sits there and no longer slides in or bounces.

I've tried a lot of different values, but they all seem to kill the movement of the tween. Any ideas here?

Dynamic Timeline Tween
I seen a "How To" on a dynamic timeline tween on this site and I cannot find it now. I have searched everywhere. Can anyone help? It is kind of hard to explain the tween but here I go. The background drops from the top but it is like "jello". It don't fall straight down it is almost like a liquid look. Thanks everyone.

Or am I crazy and it is not on this site???

Exporting Classes Not Frame 1 Kills Timeline Scripts
Why does changing the publishing settings to exporting classes in something other than frame 1 kill timeline scripts.

See file attached for example. If you put the publishing settings back on frame 1 it works just fine.

Dynamic Text Kills Button Over
I just realized the when I set text inside a button to dynamic, that when the button is in its over state, the selectable nature of the text kills the button.

All I did was draw a red square, put some text in it, make the text dynamic, then convert the whole thing into a button. I made the over state blue. When you put the cursor over the box, it turns blue, until you put the cursor over the text, then it went back to red.

Anyone know how to fix this. I just think that for what i am doing, the dynamic text looks better.

Thanks

Tween Class And Positioning Symbols
I'm currently controlling the over and out states of buttons with the tween class. I assumed the place in the string where you specify coordinates were relative to the the size of the symbols and their registration points, etc., but they are apparently not, and apparently you can't subsitute variables for those numeric values, so I'm kind of remiss as to how to accurately position the symbols...

does this make sense to anyone?

Using Tween From Timeline
How can I convert a tween I made on the timeline into either code or an instance name that I can use later? If you know any tutorial, that'll help, too .

Animating Timeline With MX Tween
I'm trying to use the Tween class to animate a timeline but it doesn't seem to work.

code:
var twn = new Tween( this.photo_wipe, '_currentframe', None.easeNone, this.photo_wipe._currentframe, this.photo_wipe._totalframes, .6, true );

Blur Using Tween On Timeline?
Is there any way to blur a bitmap image using a tween on the timeline, running through the frames?

I'd like to gradually blur an image as an animation, then move to a different page using a gotoAndPlay command. What's the simplest way to do so?

Thanks!

AS Tween And Timeline Question
Hi.

I have a MC on which i plot filled circles on positions that i get from a database.

I get the positions in an array and use a for-loop to draw each circle and a line between the positions.

This all happeneds very fast so all positions are basically drawn at once.

What i would like to have is a wait() function that i call in the loop that iterates over the array. To make a plotting effect on the line and positions.

Is there a wait(milliseconds) function in AS that halts execution?

If not then i guess i'd have to use the tweenclass to do this.
Is there a tutorial somewhere on how to set up a MC with a certain amount of frames, setting keyframes, and drawing in each frame etc?

Or is there another way to do it?

While im at it... how do i script a circle that draws itself in actionscript?

Best,
NoBuzz

Proper Timeline Tween 'etiquette'
I have had a disagreement with a co-worker about this:

When Motion Tweening on the Timeline, the space between keyframes becomes purple and has an arrow. If you set the last keyframe to 'Motion Tween', the frames after it become purple, but contain a dotted line.

He maintains that this is the right thing to do, because, if you change/swap the instance at the start of the Tween, the change gets propogated through the later keyframes; if the last keyframe is grey, and not purple, then this frame will not follow suit, and your Tween then jerkily jumps from one instance to another. (obviously, taking care and double-checking changes would eliminate this as a problem)

My view is that the end of a Tween should be a grey keyframe; that the purple frames with the dotted line is a no-no. I think that leaving the unclosed Tween on the Timeline is messy, not to mention that this prevents you from selecting the instance unless you're on a keyframe.

I'm looking for opinions on this matter - which side do you agree with? Maybe I'm just anal, but I don't agree with leaving the dotted line unfinished Tween.

Timeline Display Of Motion Tween
Hi,

I'm a new Flash user running Flash 8 Professional on a Mac (OS 10.4.8).

I noticed when making motion tweens that sometimes a black vertical bar separates the left side of the last keyframe from the tween and sometimes the line is absent.

tween.gif

I'm not sure if there's a difference when the line is missing (the top layer in the graphic above). Please let me know if you've seen this and if it means anything.

Thanks,
Adam

:: | StartDrag Disables Main Timeline Tween | ::
I have a basic DEMO built in Flash, and I am having what I think are problems with a conflicting startDrag script and a gotoAndPlay script. In summary, I have a few items placed on the main stage:
1.) the current scene's movie clip named "scene2_mc" in its own layer
2.) a movie clip, with buttons, that serves as a remote control for the current scene
2a. this mc is named "controlBoxScene2"
2b. this mc has a play button and a startDrag script on it
2c. the play button plays "scene2_mc" on the main stage
and it plays a tween that fades itself out on the main stage
2d. the layer that contains "controlBoxScene2", on the main stage, has a
frame name/label of "fade2" in frame 1 of that layer. "fade2" is a
tween that fades the controller out of view when play is pressed.

Here's the problem:
If I click the play button that is embedded in the mc/scene controller "controlBoxScene2" without attempting to drag the controller anywhere on the main stage, "scene2_mc" plays and the controller fades out as planned. If I DO drag the controller ("controlBoxScene2") to a new position on the main stage and THEN press the play button, the scene's movie clip plays as it should, BUT the controller ("controlBoxScene2") DOES NOT fade out as it should? It seems as if when I drag the controller movie clip on the main stage it is disabling the play button's ability to play the tween ("fade2"), that is also on the main stage, which fades the controller out of view?

Here's more details:

This is the script I have put on the Play button that is on the embedded controller movie clip "controlBoxScene2"

//Plays Scene 2's animation
on(release){
_level0.sceneTwo_mc.gotoAndPlay("start")
}
//this fades out the controller on the main stage
on(release){
_level0.gotoAndPlay("fade2");
}

The Play button is inside the movie clip "controlBoxScene2" which is placed on the main stage. I have placed a startDrag script on the "controlBoxScene2" movie clip so that users can move "controlBoxScene2" into a place where it does not obstruct the view of the current scene before the user presses the Play button, which will fade out the obstructing "controlBoxScene2"

This is the startDrag script I have placed on the movie clip, that is now on the main stage:

//Drag ControlBox on stage
on (press) {
startDrag("_level0.controlBoxScene2");
}
on (release) {
stopDrag();
}

The play button is embedded, on its own layer, in "controlBoxScene2" Another layer in "controlBoxScene2" has a symbol that has the startDrag script applied to it. This seems like a lot to swallow, but I tried to be as detailed and clear as possible. Basically my question is, why won't the fade2 tween work once I drag the controller? Do I need to drop startDrag, and use another method perhaps?

I tried to attached an example fla file, but it doesn't seem to be working? Can you see the attached file? It looks strange b/c I had to remove all confidential material. I saw a ton of threads that were similar, but I could not use them to answer this question clearly.

Thanks,

[F8] Tween Class; Great, But What About W/ Timeline Sequencing?
I've been trying to create an animated trailer, with moving images and text.

Instead of working with loads of keyframes, easing, and lots of timeline stuff, I've been using the Tween class. Even with the little I know of AS 2.0, using the Tween class on an object for fade & movement is working much easier than all the keyframe adjustments.

I'd like to create a movie with multiple objects (i.e. many layers), but how do I work out timeline sequencing w/ Tween class AS? I know how to do it with the timeline and keyframes, but using AS for animation is new to me.

I've posted the .fla file I'm working on as a model: www.focus97.com/test/tweenfades.fla

I'd like to create an entire 30 second movie with one frame, using AS in each layer. What I'm thinking is layer 1's AS would start immediately, and then if I want layer 2 to start 2 seconds later, I'd need a delay or something, yes?

Is there a good way to create a movie with AS, different from what I'm suggesting?

F8 BUG?- Timeline Anim. Not Working After Tween Class
I think I may have found a bug in F8 regarding the tween class. For the life of my I can't figure out what's wrong.

I have a movieclip with a tween class animation that works fine. After the tween is done I try to animate the same Movieclip with a regular timeline (keyframe) animation and it will NOT work. It doesn't matter what property I assign... but if I move the keyframes of the exact same movieclip to another layer it works... WHY? I know for a fact the it is moving on the timeline because I'm tracing it, but the stage doesn't show the animation of the Movieclip. I have tried to make the tween class var as both undefined and null, but still doesn't work. Any ideas!!! I"m stumped.

code I'm using (works fine):

Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
stop();
var xScaleT:Tween = new Tween(txtBoxMC, "_xscale", Strong.easeInOut, 200, 100, 1.7, true);
var yScaleT:Tween = new Tween(txtBoxMC, "_yscale", Strong.easeInOut, 200, 100, 1.7, true);
xScaleT.onMotionFinished = function() {
gotoAndPlay("fadeout");
};

Timeline Motion Tween Issue (Weird)
Hi all,

I have some problem about timeline motion tweens in Flash CS3.

In two projects I have faced the same problem.

When I compile the SWF, some timeline animations do not play accurately.

But if I enter the edit mode of that movieClip and slide through timeline and compile the SWF again, oops the animation plays perfect until I close the FLA and open it again.

This is so weird I think.

I've tried to compile for different Player Versions, tried the silent sound trick and some more... But no solution.

Does anyone have an idea about this?

thank you for your time...

Prefomance: Tween Classes Or Timeline Tweens?
Prefomance: tween classes or timeline tweens???
At the moment I'm using tween classes, they have a lot of possibilities and the main feature thet thay can be easily controlled by AS functions... But I don't know about its performance... Is it good or not?

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

Is Actionscript Tween Fading Smoother Than Tweening In The Timeline?
I am working on a site that is using alot of fading. Is it smoother to fade a photo using actionscript or does it really make no difference?

Looping A Motion Tween/movie Clip While Timeline Has Come To Its End?
I have a layer with a movie clip on it, this movie clip animates itself and has a motion tween to move across the screen. I want to repeat this motion tween while the main timeline has finished. I know its using actionscipt, but I cant seem to get it right.
Cheers for any help.

Action Script Control Interferes With Timeline Tween
I've searched but found nothing about my problem, here it is :

Let's say we have in the root scene a movie clip main_mc,

this clip contains two movie clips object1_mc and object2_mc, each one in a separate layer, with on each a tweening modifying their alpha property.

the effect is you see object1_mc in frame 1, then object2_mc is fading in while object1_mc is fading out, and then object1_mc is fading in back while object2_mc is fading out.

this was working perfectly well

then, I added some action script in the root scene about main_mc, looking like this :

code: main_mc.onEnterFrame = function()
{
main_mc.object1_mc._x += 5;
}

the result is that object1_mc is moving okay, but is not fading anymore...

it seems that controlling an object through action actionscript makes it to not take in count the tweening of the timeline...

I've resolved this problem by managing the alpha in action script too, but I'd like to know if I missed something and if I could have kept my placement control by actionscript AND my fade control by timeline tween.

thanks.

Animations W/ Tween Class; Great, But What About W/ Timeline Sequencing?
I've been trying to create an animated trailer, with moving images and text.

Instead of working with loads of keyframes, easing, and lots of timeline stuff, I've been using the Tween class. Even with the little I know of AS 2.0, using the Tween class on an object for fade & movement is working much easier than all the keyframe adjustments.

I'd like to create a movie with multiple objects (i.e. many layers), but how do I work out timeline sequencing w/ Tween class AS? I know how to do it with the timeline and keyframes, but using AS for animation is new to me.

I've posted the .fla file I'm working on as a model: www.focus97.com/test/tweenfades.fla

I'd like to create an entire 30 second movie with one frame, using AS in each layer. What I'm thinking is layer 1's AS would start immediately, and then if I want layer 2 to start 2 seconds later, I'd need a delay or something, yes?

Is there a good way to create a movie with AS, different from what I'm suggesting?

Help Implementing The Tween Class (to Convert Timeline Animation To AS)
Hey guys,
Total n00b here at ActionScript. What I'm trying is to come up with a block of AS code that can be applied on any two pictures to achieve this effect: http://www.toxiclab.org/tutorial.asp?ID=195

As you can see from that tutorial, while the effect itself is very easy to create, it gets repetitive and tedious if applied to a large set of pictures. So I was thinking what if a come up with a routine that can do the same given a set of 'n' pictures.

Can any please set me off in the right direction?

Thanks,
m^e

Can SetInterval Smooth A Timeline Based Motion Tween?
Is it possible to have setInterval, smooth out a traditional motion tween animation rather than having to animate via actionscript?

I'm a noob with actionscript, plus this is because i need to animate an image along a motion guide.

U guys are clearly pro and im sure you have a solution for me

Thanks Guys.

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
//}
}

Copyright © 2005-08 www.BigResource.com, All rights reserved