Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

flashmx scripted motion problem 1

Status
Not open for further replies.

PaulFynch

IS-IT--Management
May 23, 2002
105
CA
this is difficult to explain, i will attempt to be clear.

simple slide show
here is the code and the problem

function moveObject (objecttoMove, newPosition){
objecttoMove.onEnterFrame=function(){
this._x-=(this._x-newPosition)*.5
}
}


function indexUp(){
_root.oldIndex=_root.currentIndex+1;
_root.newIndex=_root.currentIndex;

_root.moveObject(_root["h"+_root.oldIndex], -341);

_root.moveObject(_root[&quot;h&quot;+_root.newIndex], 0); <<< **problem lies here**

_root.currentIndex=_root.currentIndex-1;
_root.right.gotoAndStop(2);
_root.gotoAndPlay(4);
}
stop();

*note: indexUp() is called from the &quot;next&quot; button ( on(release) ).
on the first part of the indexUp() function, i take the picture currently being displayed on the stage and slide left, works like a charm. at this point, it moves the MC holder &quot;_root.h3&quot; (value of _root.oldIndex being 3)
the value of _root.newIndex is 2, the MC holder i want to move is &quot;_root.h2&quot;, but it does not move.

any thoughts?

cheers
 
Would be easier for me to test it out in front of me.
Any way to get a .fla, or a mockup .fla, recreating the situation?
Zipped up and in MX only format.
 
oldnewbie, i will gladly give you everything required...


i have suspicions about what is happening, but dont know how to fix it, it has to do with the moveObject loop.

when i do this

function moveObject (objecttoMove, newPosition){
objecttoMove.onEnterFrame=function(){
this._x-=(this._x-newPosition)*.5

trace(this._target);


}
}


i just get h3 (which it should be the first time) coming up again and again etc.

any help would be awesome

cheers
 
What is supposed to be happening exactly?

Top picture slides out of view, immediately followed by the underlying picture, as an apparent combined slide? And so fourth until Mickey slides in to view... Is that it?

And the other button would reverse that?
 
that is correct.....
the other button im not really worried about, i think thats the easy part....

should i not be able to move both those pictures with that one function (by calling it twice i mean)

that is i am assuming that when you hit the &quot;right&quot; button, the centre pic moves but the right one doesn't?
 
Ummmmmmmh! Think both moves would have to be in the moveObject function... and only one call to it.
Furthermore, think you should delete the onEnterframe's when the pictures have reached the new positions.

I'll test this further after dinner, but that's where I'm at as of now!
 
thanks for your help oldnewbie, i await your insight...

enjoy your dinner!

cheers

paul
 
Ok! This seems to work... I say seems, because I've only tested this locally, and don't really know if your preloader code would work if online. Didn't check that part, but the slide seems to work fine!

Please advise when you have downloaded it. Can't keep it up for very long...

 
i got it downloaded and am looking at it now....
ps thx
 
MAN YOU ROCK SO MUCH YOU DON'T KNOW HOW MUCH!!!!
Just for the record, this star for oldnewbie is officially and actually TEN stars ;)

thanks very much

cheers!
paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top