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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrolling graphic in flash 4

Status
Not open for further replies.

cinesina

Programmer
Nov 20, 2001
6
IT
Calling all cars,

(Ok, if it can't be done in Flash4, then I'll upgrade and TRY to understand Flash5.)

I'm trying to create a scrolling box with graphics (not a text scroll).

To take a look at my embarrassing attempt:
As a temporary solution, I've created a movie that has a graphic that moves up and down as you go through frames. I've put in a script for the up arrow that directs the movie to go to "previous frame" when pressed, or to go to "next frame" when the down arrow is pressed. I need a smooth scroll instead of tiring out my index finger.

I've also used a script that works, but only for the down arrow: "on press" tell (target) "play". That works, but how do I do the reverse for the up button.

Any suggestions?

-Cinesina
 
Flash 4! Long time ago nowadays!
Don't remember if there was _currentframe in Flash 4, but if there was, then you could probably build a "reverse play" with the tellTarget action...

on (press) -> tell (target) -> gotoAndStop(_currentframe -1)... Regards,

new.gif
 
Thanks for your quick response, oldnewbie!

I tried the suggestion, but I get the same result. "On press tell (target)…" causes the frame to stop on press. I'm looking to hold down the press button and get a continuous scroll. Is there a boolean solution?
 
Scratching head Flash 4 mmmm.
can you use 2 movie clips called play & reverse. stop() on frame 1. Frame 2 telltarget >nextFrame()/prevFrame() frame 3 gotoandPlay(1).

on press telltarget play>gotoandPlay(2).

hope that makes sense or works in 4.......
 
Scratching head Flash 4 mmmm.
can you use 2 movie clips called play & reverse. stop() on frame 1. Frame 2 telltarget >nextFrame()/prevFrame() frame 3 gotoandPlay(2).

on press telltarget play>gotoandPlay(2).

hope that makes sense or works in 4.......
 
Scratching head Flash 4 mmmm.

can you use 2 movie clips for the movement called play & reverse. stop() on frame 1. Frame 2 telltarget IMAGE >nextFrame()/prevFrame() frame 3 gotoandPlay(2).

on rollover(forward) telltarget play>gotoandPlay(2).
on Rollout(forward) telltarget play>gotoandStop(1)

hope that makes sense or works in 4.......
 
sorry, had a few probs with browser then...... can u edit or delete posts...
 
Nope! Can't edit... Unless you red flag it and explain... But in this case, leave it! Regards,

new.gif
 
Benjer,

I had a tough time trying to decipher your syntax (sorry, it may be that I'm not a Flash 5 user, or that I'm just not experienced enough with action scripting).

In any case, I believe you're suggesting one movie that plays forwards, while the second movie plays backwards. That's not a bad idea, but how does the code work to pick up the current frame number shown AND load that frame number of the opposite movie before playing again? (part of the mystery is how do flip back and forth between movies).

Although I'm really interested in finding the solution this way, here's another idea: Maybe I can just change the "y" variable of a graphic with a script along the lines of an "if press"/"y-1" solution.

-cinesina
 
its not 2 movies. you have your movie where the image is tweened. the 2 movies i explained make it move forward/backward. well you could script it, just not sure how much control flash 4 gives you (its been a while). here's code for a button which will show/hide a tweened graphic, using code as explained before.

on (rollOver) {
tellTarget ("fade_down") {
gotoAndStop(1);
}
tellTarget ("fade_up") {
gotoAndPlay(2);
}
}
on (rollOut) {
tellTarget ("fade_up") {
gotoAndStop(1);
}
tellTarget ("fade_down") {
gotoAndPlay(2);
}
}

fade_up, frame 1
stop()
frame 2
tellTarget ("../yourTweenedMovie") {
nextFrame();
}
frame3
gotoAndPlay(2);

fade_down is the same but use prevFrame().

so basically it wall call the movie, which only has script to make your graphic fade up/down. its hard to explain but all the code is on this page....
 
I racked my brain for a while and like the last drop you squeeze from a spunge, I made it! PS - I modified the script a bit by using "gotoAndStop(1) on (RollOut)"for "fade_down" because I was getting a bouncing effect.

What a dream! Thanks a lot for your help! You're a genius!

-Cinesina
 
I've resolved the scroll up/down problem (thanks to you). I even created the scrolling "bar" with the same script. However, the bar doesn't have any interactive capability. I'd like to create a script something like "on press and drag" to scroll up and down. Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top