Scroll Doesn't Stop :(
I wrote this code for scrolling content:
ActionScript Code: onClipEvent (mouseDown) { if (this.hitTest(_root._xmouse, _root._ymouse)) { var uppressed = true; updateAfterEvent(); }}onClipEvent (enterFrame) { if (uppressed) { if (count != 125) { _parent._parent.news._y -= 5; count += 5 } } updateAfterEvent();}onClipEvent (mouseUp) { uppressed = false; updateAfterEvent();} and for opposite: ActionScript Code: onClipEvent (mouseDown) { if (this.hitTest(_root._xmouse, _root._ymouse)) { var dnpressed = true; updateAfterEvent(); }}onClipEvent (enterFrame) { if (dnpressed) { if (count != 0) { _parent._parent.news._y += 5; count -= 5 } } updateAfterEvent();}onClipEvent (mouseUp) { dnpressed = false; updateAfterEvent();} When I scroll down it works and stops when count reaches 125, but when I scroll up it doesn't stop and scrolling down doesn't work anymore... Any help?..
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 01-10-2004, 07:06 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Scroll Doesn't Stop :(
I wrote this code for scrolling content:
ActionScript Code:
onClipEvent (mouseDown) { if (this.hitTest(_root._xmouse, _root._ymouse)) { var uppressed = true; updateAfterEvent(); }}onClipEvent (enterFrame) { if (uppressed) { if (count != 125) { _parent._parent.news._y -= 5; count += 5 } } updateAfterEvent();}onClipEvent (mouseUp) { uppressed = false; updateAfterEvent();}
and for opposite:
ActionScript Code:
onClipEvent (mouseDown) { if (this.hitTest(_root._xmouse, _root._ymouse)) { var dnpressed = true; updateAfterEvent(); }}onClipEvent (enterFrame) { if (dnpressed) { if (count != 0) { _parent._parent.news._y += 5; count -= 5 } } updateAfterEvent();}onClipEvent (mouseUp) { dnpressed = false; updateAfterEvent();}
When I scroll down it works and stops when count reaches 125, but when I scroll up it doesn't stop and scrolling down doesn't work anymore... Any help?..
Scroll Bar Component Doesn't Scroll When Dynamic Txt Is Used?
I have a dynamic text box with the Flash UI component "Scroll Bar" attached to it. It works and scrolls fine when you enter text directelly into the dynamic box but when you use the loadVariables command to load an external txt file into it, it fails to scroll the text?
Is there a way to get it to scroll?
thx Bk9
Scroll Gallery [doesn't Scroll After Particular Point]
Hello guys,
I have got this script from one of the opensource files on flashkit and want to use it for one of my requirements. Basically all I want to do is, scroll images vertically based on mouse movement. I've done that already but the issue is that when I have over 10-15 images, it doesn't scroll as there is no place left for the mouse to go further down. If you have a look at the attached file, you'll know what exactly I am talking about. Ideally, if mouse is held downwards, the images should keep scrolling untill it reaches it's end.
Can anybody have a look at the fla and help me out.
Cheers,
D
Sound Doesn't Stop
i'm new on flash, but i feel, that flash will be part of my life
my problem is following. i've got to soundloops, for two scenes. But in scene 2 the sound-loop is still playing.
where's my mistake? thx in advance for any answer (hopefully solution)
Music Doesn't Stop, It Does But....
Ok, I'm in trouble once again: I made a MC with some music, everything is fine, I created a button for music on/off, fine. Starts the movie, I turn off the music and go on connecting to other frames in the scene, but when I go back to the main page the music starts again even though the button is off, what's wrong with it??? I'm going insane. Thanx for your help!!!
Gotoandstop Doesn't Go To, Or Even Stop
Here's what I'm experiencing: I have a game charachter who contains banks of animations on seperate frames. Depending on which button you press, it moves him to a specific frame, so the animation will play. The problem with this has been that it tries to go one frame beyond where I tell it to. And when it gets there, the movieclip on that frame stays still. And it's the wrong frame! And then it plays on to the next animation randomly! O_o
Really, it's gottent to be a terrible mess now. After some working on it, I've gotten it to be functional, but only by adding an additional frame, so the numbers don't match up. If anybody can figure out what went wrong without my needing to post the code, I'd appreciate it. If it's not enough information, I'll post the code later. Thanks.
*Just a note... when I was testing the game once, everything froze, and then my computer rebooted... But since that hasn't hapnnened after that, and one harddrive was powering up at the time, I didn't think there was too much of a connection...?
StopDrag Doesn't Stop
I'm making a "makeover" game of one of my teachers to show to the entire school (with his permission) on Tuesday. I am using the following code to drag the articles of clothing.
Code:
on(press) {
this.startDrag();
this.gotoAndStop(2);
}
on(release) {
this.stopDrag();
}{
My problem is that stopDrag doesn't stop the Dragging everytime. About 10% of the time, the piece sticks to my mouse and i drag it all over, no matter how much i click. How can i fix this?
My Button Doesn't Stop...
I am trying to create a pinwheel effect on a button that when you mouse on to the button it starts to spin slowly then speeds up to full and when you roll off slows down to a stop.
The problem I am having is that it will start spinning on it's own then when you mouse over it starts and keeps going (the way it's suppose to) and when you roll off it slows down to a stop (great), but then will start spinning again.
If you don't mind taking a look at what I have done, and advising on how to fix it, I would be very greatful (and less bald as I am currently pulling out my hair!!)
Thanks
[F8] [AS 2] GotoAndStop And It Doesn't Stop, Please Help.
Hello,
My problem is that I'm trying to use a simple "gotoAndStop" and it doesn't stop. I do know why, what I don't know is how to fix it.
There's a small square button with the number 15 that you click and it should take you wherever #15 image is and stop... but it's not stopping.
You can see the intro here: http://www.ricardozea.net/images/lk-jewelry.html
In between each image I'm using a Timer, it waits/stops for 3 seconds and then continues, here's the code:
Code:
stop();
wait_time = 3000;
start_time = getTimer();
this.onEnterFrame = function() {
//trace(now_time - start_time)
now_time = getTimer();
if ((now_time - start_time) > wait_time) {
play();
}
};
I see that this piece of code is not letting the simple "gotoAndStop" work, but I don't know how to fix it.
Can anyone please give me a hand?
Thank you.
AS3 Stop(); Doesn't Work
Hey, I just got Flash CS3. I'm trying to get my main timeline to stop in the begining, on button press to play and at the end stop again. In AS2, you would just put stop(); on the first keyframe and stop(); on the last key frame and program your buttons accordingly. The stop(); does not work!!!! It's driving me crazy. What am I missing? I've gone through the tutorials in Flash and they don't work either. Help!
Also, if you have MovieClip that contains an animation and you don't want the movie clip to be on a continuous loop how do you stop it from playing. In AS2, I would put a stop(); on the last keyframe of the movieclip's animation. This also does not work in AS3. Any help would be great!
Thanks!
Sound Doesn't Stop
I just import my audio into my library, and I chose a keyframe and below in the properties inspector you get to choose the sounds in your library. I did it that way, but when you pause the movie the sounds keeps going.
So, I want it to stop the sound when the user right-clicks on my animation and un-select the play in the menu.
Any help would be great!!
Help Stop() Doesn't Work
I have been working in flash for years and this has never happened to me before. I am creating a calendar with a labeled area for each calendar, plus a labeled area for each month to load an external intro movie for the month.
There are just basic stop actions in the labeled areas and I cannot figure out why it wouldn't be working. Is there some bug in Flash 8 that I haven't been able to discover?
Tween Doesn't Stop
Hello
My problem is that I have a movieclip that initiates a function when clicked. This function contains if-statements to find out if the movieclip has been pressed before. I then uses w.stop(); to stop a tween started before, but i doesn't work!
I want to stop the tween because otherwise the onMotionFinished-statements are executed and I don't want that until the tween really is finished. Can anyone help me?
Attach Code
function showModel() {
var box = this.imageholder;
var image = this.t;
var w:Tween = new Tween(box, "_width", Regular.easeOut, box._width, 300, .8, true);
var h:Tween = new Tween(box, "_height", Regular.easeOut, box._height, 400, .8, true);
var tx:Tween = new Tween(image, "_x", Regular.easeOut, image._x, 10, .8, true);
var ty:Tween = new Tween(image, "_y", Regular.easeOut, image._y, 10, .8, true);
w["onMotionFinished"] = function():Void {
//my statements
};
if(box._width < 83) {
thumb._alpha = 100;
} else {
this._alpha = 100;
w.stop();
h.stop();
tx.stop();
ty.stop();
}
}
GotoAndStop() Doesn't Stop
Gentlefolk;
Lots of discussion here on gotoAndStop(), but the solutions are not working for me.
My use of gotoAndStop("Frame1); plays the entire movie clip. Where am I erring?
the code, attached to a button, is:
on (release) {
gotoAndStop(5);
contentHolder_MC.attachMovie("InitialRequest_ID","InitialRequest_MC",1);
contentHolder_MC.InitialRequest_ID.gotoAndStop("Frame1");
}
What is supposed to happen is on release, the main timeline goes to frame 5 and stops.
That works correctly.
In the movie clip called ContentHolder_MC, which is a box holding content in the MC "InitialRequest", the MC does display in the ContentHolder.
But, the second "gotoAndStop("Frame1"); ends up playing the entire movie and not stopping on "Frame1".
I want to use this technique of using named frames to display different content in "ContentHolder" but can't get the called MC "InitialRequest" to stop on the specified frame.
Can someone correct my approach?
Many thanks!
Don
AS3 FLV Sound Doesn't Stop
I have a swf with 4 scenes, in each scene there's a FLV video. I have buttons going to prevScene and nextScene and when go back and forward I hear the sound of another FLV, any ideas?
the code for the buttons (for example) is
button1.addEventListener(
MouseEvent.MOUSE_UP,
function(evt:MouseEvent):void {
myPlayer.stop();
SoundMixer.stopAll();
prevScene();
}
);
SWF Doesn't Scroll
I loaded an SWF file into a dynamic text field. But the SWF doesn't want to scroll (normal scrolling not thru tweening). I wonder why! I have been trying to solve this problem for a week now, but to no avail. Please help!!
Graphic That Counts And Doesn't Stop
I've seen a website before where it said.... 200,300 killed and it keeps counting up and doesn't stop. This was done thru flash but I tried and tired to get it but I can't seem to find out how to do it. I figured I would use the count but I was told the only way you can take a numerical text and make it count up dynamically is thru actionscript. Can anyone put me in the right direction. THanks
Mc Doesn't Play/stop Accurate
check this site
www.pasha.be
in the mean movie there's an equalizer on the bottom (right).
if you push the x the clip stops, that's okay
if you push 1 (loop1) the clip starts playing, but if you push it twice, the clip stops again...
anyone?
Playhead In Reverse; Keeps Going, Doesn't Stop
hey there, i'm just having a bit of a problem with my site, i've got the playhead to play backwards using the following script. But because there's an onEnterFrame it ignores my (stop (); at this frame). How would i get the playhead to stop at a labelled frame instead of just continuing on? thank you
on(release){
this.onEnterFrame=function(){
if(this._currentframe>1){
this.prevFrame();
}
{if(this._currentframe("preview")
this.stop();
}
else{
delete this.onEnterFrame;
}
}
}
[MX]gotoAndStop Button Doesn't Stop;
Seemingly simple, yet very frustrating. I've got this button:
Code:
on(release){
gotoAndStop("Game", 1);
}
and in the scene it goes to there's just a stop(); , BUT it doesn't stop and goes instantly to the previous scene with the button again.
Is it just some problem MX has, or what could be wrong?
[CS3] [AS2] Code Doesn't Stop Running
This has become frustrating! I'm trying to figure out how to stop code that generates a starfield for the intro sequence. It works where it should, but oddly enough - even using a blank keyframe - It still spills out into the second frame. Stop(); is included in all the frames, but it doesn't make a difference. I tried onEnterFrame();, and that only made it worse - causing the entire thing to start "skipping" as if there were no Stop calls in the code at all.
It should basically stop running in frame two, but doesn't - here is my code thus far, all located in frame one:
Code:
var frame:MovieClip = attachMovie("frame_mc", "frame", 1000000);
for (var i = 0; i<950; i++) {
var nm = "star"+i;
_root.attachMovie("star",nm,i);
_root[nm]._x = Math.random()*750;
_root[nm]._y = Math.random()*400;
_root[nm].distance = Math.random()*200+1;
_root[nm]._xscale = 250/_root[nm].distance;
_root[nm]._yscale = 250/_root[nm].distance;
_root[nm].speed = 50/_root[nm].distance;
_root[nm].onEnterFrame = function() {
this._x += this.speed;
if (this._x>750) {
this._x = 0;
}
};
}
stop();
Why Doesn't My Movie Stop On Frame 4?
I'm using
stop();
It just plays over and over and ignores the stops. What am I not getting here?
Thanks.
BTW: I'm new to AS3 and am having lots of problems. Being more of a designer than a coder I miss the way I used to be able to code in AS1 & 2. sigh
Dynamic MovieClip Doesn't Stop
Hello,
i have a swf-player, which load dynamicly several external swf-files. this all works without problem. my problem is, that the movie doesn't stop after playing once on end. if i click on the button, it works, but not at the end.
ActionScript Code:
...
arrMediaFile = strMediaFile.split(";");
arrMovieClip = new Array(arrMediaFile.length);
arrMovieLoaded = new Array(arrMediaFile.length);
for (i=0; i<arrMovieLoaded.length; i++) {
arrMovieLoaded[i] = 0;
}
createEmptyMovieClip("myVideo",1);
createEmptyMovieClip("nextVideo",2);
myVideo._lockroot = true;
...
myVideo.loadMovie(arrMediaFile[0]);
frmOfVideo = myVideo._totalframes;
offset = lengthBar/frmOfVideo;
// Play
play_btn.onRelease = function() {
VideoStatus(1);
}
// Pause
pause_btn.onRelease = function() {
if (statusVideo == 0) {
VideoStatus(1);
} else {
VideoStatus(0);
}
}
// Rewind
rwd_btn.onRelease = function() {
myVideo.loadMovie(arrMediaFile[0]);
VideoStatus(0);
// Here is my problem. The movie doesn't stop here!
myVideo.gotoAndStop(1);
}
function VideoStatus(fStatus) {
if (fStatus == 1) {
// play Video
if (fStatus != statusVideo) {
statusVideo = 1;
myVideo.play();
}
play_btn._visible = false;
pause_btn._visible = true;
} else {
// pause Video
if (fStatus != statusVideo) {
statusVideo = 0;
myVideo.stop();
}
play_btn._visible = true;
pause_btn._visible = false;
}
}
function timeCallback() {
...
currentVideo = 1;
trace("VIDEO: goto first");
unloadMovie("myVideo");
myVideo.loadMovie(arrMediaFile[currentVideo-1]);
// Here is my problem. The movie doesn't stop here!
myVideo.stop();
....
}
setInterval(timeCallback, 50);
what do i wrong?
thx!
red
=> the complete code is in the attachement.
Stop Action Doesn't Work
I have a simple website with five pages set up. There is no code other than the code on the first frame, plus a stop action on each section. The first thing in the code is the stop action, but it still keeps running through all the frames when I test it, and a movie clip set up in a similar way does the same thing. What could be causing this? I tried taking all the code out of frame 1 except the stop action but it didn't make any difference. I am starting to work with actionscript 3.
thanks
Attach Code
stop();
//LINKS FOR MAIN BUTTONS - ACTIONSCRIPT 3 CODE
//home button
//make new function called home which sends to home page
function goHome(e:Event)
{
gotoAndStop("HOME")
}
//make listener for home button,
//tells it to use goHome function on mouse click
btnHome.addEventListener(MouseEvent.CLICK, goHome);
//group button, name of button is btnGroup,
//name of page is "GROUP", name of function is goGroup
function goGroup(e:Event)
{
gotoAndStop("GROUP")
}
btnGroup.addEventListener(MouseEvent.CLICK, goGroup);
//reviews button
function goReviews(e:Event)
{
gotoAndStop("REVIEWS")
}
btnReviews.addEventListener(MouseEvent.CLICK, goReviews);
//clientlist button
function goClientlist(e:Event)
{
gotoAndStop("CLIENTLIST")
}
btnClientList.addEventListener(MouseEvent.CLICK, goClientlist);
//listen button
function goListen(e:Event)
{
gotoAndStop("LISTEN")
}
btnListen.addEventListener(MouseEvent.CLICK, goListen);
//END LINKS FOR MAIN BUTTONS
Why Doesn't Preloader Stop Movie?
I'm pulling my hair out on this one.
Here's the fla if you can help:
http://www.argoncreative.com/test/testpreloader.fla
The movie has a preloader in frame 1 but the movie just plays through ignoring the conditions of the preloader.
<cursing his flash ignorance>
t2d
Sliding Menu Doesn't Stop Where It Should
Hi,
I created a page using the sliding menu but I seem to have a problem with the way it stops on a movie clip. If I add too many movieclips (don't know if it's the number or the width of them causing the problem) the script doesn't stop right on the center of the movieclip. it looks like it doesn't stop smack down centered and it gets worse the more movieclips you add.
Can anyone help please? this is the page I made http://www.thenextmen.com/
If I add more links the content in the middle is not aligned. Every movieclip is the same size.
Thanks
Ben
Stop(); In First Frame Doesn't Work. Why?
Hi!
I sometimes run in to this weird problem where my stop(); frame doesn't actually stop. I have a movieclip named NestingMc which I bring to the stage via actionscript. Inside my NestingMc I have a movieclip ChildMc. ChildMc has a timeline on it's own and on the first keyframe of that timeline I have written a simple stop(); command. But my ChildMc doesn't actually stop in the first frame it just plays to the next keyframe that has a stop(); command.
Anyone?
Playback Doesn't Stop On 1st Scene
I have a flash movie that had many scenes. The first scene is a menu but when I export the movie it doesn't stop at the menu but plays the next scene. I have a stop action on the menu. Any idea on why this is happening will be most appreciated.
LoadMovie Doesn't Scroll
I create a movie with scrolling text box - which worked fine.
but when I LoadMovie it onto my main movie, scroll bar doesn't work!!
Someone help me please!!
(The tutorial I used is at http://www.flashkit.com/movies/Inter...3587/index.php)
Text Doesn't Scroll
I have this fla file.
the text (istance name "bellezza" doesn't scroll. I'm using 2 bottons with a script attached...but text doesn't move.
Script seems to be right.
what's wrong?
please help.
thanks
Profession MX Doesn't Have Scroll Bar?
hi I'm new here.
Got a question:
in the MX version the scroll bar can be created with the scroll bar component, right?
How come there isn't in the Professional MX? I can only see scroll text area.
If that's true, then how can I make a scoll bar in the Professional MX?
Millions of thanks
Sound Doesn't Stop Until I Quit The Browser
Hey, Flash maniacs!
I posted this in the "music and Sound" section but nobody replied - I still hope that some of you, gurus, juust don't go there and this is why there's no reply yet Anyway, here's what happens - I have a main .swf that contains all the graphics and then I have all my sound files on different .swfs. The first frame of my main movie calls the background sound loop .swf. When I close the browser window where my main movie is playing, the background music doesn't stop. I have to quit the browser (not only close the window!!!) in order to stop it playing... Any clue anyone?
Thanks a lot!
Music Doesn't Stop Until I Close The Browser
Hey people, I'm sorry I'm posting this again, but I still haven't found the solution to my problem and, on top of that, I guess my previous post didn't make a lot of sense to those of you who use PCs only. Anyway, on a Mac you can have a browser (or, for that matter, any program) started but no window (existing or new document) open. So, let's say I have the browser open and a window in which the HTML page containing my flash movie (with its background music) playing. Then I have other pages open in separate windows in the same browser. When I close the window containing the flash movie with the background music, the music doesn't stop. I have to close (quit) the browser (which closes all my other open pages) in order to have the music stop. This happens only on a Mac. Sorry if I was vague in my previous post and I really hope somebody knows what this is all about This is not the first time I see this happen and I am not the only one having experienced this Thanks for all your help, Flash gurus!
That Scroller Doesn't Stop, I'm Feeling Sea-sick;)
step by step, I'm trying to learn. but now I've got another problem. I've got a sliding menu in a movie clip that activates various movieclips when I press the buttons like the one in
http://www.flashkit.com/movies/Inter...-463/index.php
taking this movie as an example, I'd like to understand
1) if the scrolling of the menu can be activated ONLY when the mouse is on it (Dunno, I really can't figure out HOW )
2) if there is a way to stop it when the mouse is over it; I've tried inputting commands such as on mouseover stop/on mouseout play but probably I'm waaaaaay out from the right path...
can you help me!?
Play/stop Doesn't Work Properly With MC
hi there
please go to www.pasha.be
you can choose some loops at the right bottom... a LED is also playing when the loop plays, but if you push a loop one time (while the LED is playing) is stops again.... :O(
can somebody help me?
greetz
melvin
[F8] Help My Flash Page Doesn't Stop Looping.
http://www.abccreativegroup.com/optimized/main.html
This is a website I am working on right now, and for some reason, it keeps looping!
There is a main page, and each link loads a new .swf onto a blank movie clip. I have the stop(); action at the end, but after I click on a few links, it keeps looping for some odd reason.
I need help pronto, since our client needs to loop at this asap, and I don't want to send it to him like it is!!
-Manny
[CS3] Uploaded Site Doesn't Stop On The First Page
Complete newbie, just started this today... I'm following a tutorial and trying to make a website, just as a test to see if I get any of it. It works quite all right - except when I upload it and access it. Then it just moves from page to page to page, instead of stopping on the first page. If I click the links, it stops going round and round, but I want it to stop immediately, on the first page (the 'about' page).
The swf-file can be viewed here: http://cosmicuniverse.net/test/test.html
The flash-file can be downloaded here: http://cosmicuniverse.net/test/test2.fla
If anyone could explain in very small words (remember, complete newbie), I'd be very grateful. I thought I'd followed the tutorial to the t, but I've obviously missed or misunderstood something.
Cam
Dynamic Flvs, Doesn't Stop Problem
I have a flash piece that has 3 buttons. Clicking a button will load a respective .flv into a single flvplayback component in a separate movieclip on the stage. The flvplayback component movieclip also has a button to close the movie & removes the video from the stage. Clicking any of the 3 buttons dynamically loads either of the 3 .flvs correctly. They play correctly. When I click the close button to stop the video and remove the player from the stage the audio keeps playing but the video is gone. Is there a better way to stop the .flv from playing on the stage? Here's the code that stops the video.
_root.videos_mc.btnCloseVideos.onRelease = function():Void {
videos_mc._visible = false;
_root.videos_mc.videoPlayer.stop();
_root.videos_mc.videoPlayer.clear();
_root.videos_mc.videoPlayer.contentPath = null;
}
Thanks in advance for your help.
zak.
Loaded Swf Song Doesn't Stop Playing
I'm making a small music player that loads remote swf files (containing a song) using the MovieClipLoader class. The swf is loaded into a target clip swfContainer_mc. When the stop button is clicked I just tell that clip to stop using this code:
Code:
swfContainer_mc.stop()
This works locally but when the (same) player is tested online, it fails to work. I added this to the code when the stop button is clicked:
Code:
swfContainer.unloadMovie()
But even that failed to work online.
Anyone got an idea or any pointers where to look first?
Something to do with speficic settings for the Flash player?
Tnx in advance,
M.
Flash Doesn't Execute The Stop() Function
Hi i have a question:
I have made a flash file with several movieclips that all have a stop() function at the end.
When i look at the .swf file it is working perfectly.
Only when i upload it to a site then it doesn't execute the stop() function.
When the flash file has stopped playing it should upload another flash file so the stop() function must be used.
I am using AS 2.0 , only that shouldn't matter because i am only using stop() functions.
Thanks
Text Scroll Doesn't Work?
View this link for a better understanding:
http://www.geocities.com/dimple_gyrl/sorce_movie2.html
I want to have a text field display next to the bitmaps (as a description of the bitmaps) But I don't know why the text is not loaded and the scrollbar is not even showing when I posted up on the web (the scrollbar was there when i tested the movie in flash)
This is what I did:
I created two layers and four frames. One layer contains the text field and the other layer contains the scroll arrows. I labeled frame #2 "load" and frame #4 "end" in the text field layer.
Here is the script I have for each frame in text field layer:
frame #1:
loadVariablesNum ("./text.txt", 0)
frame #2:
if (text ne "")
{
gotoAndStop ("end");
}
frame #3:
gotoAndPlay ("load");
frame #4:
stop();
I think the actionscript that I'm having are right but for some reason, the text wouldn't load up.
Can you tell me what i'm doing wrong?
Thanks for your help!!!
Anh
This Doesn't Make Me Scroll Slowly
Hey, I was hoping to write a function that would scroll an object slowly.
This seemed like a good concept, but it doesn't work.
This is in my actions layer:
Code:
var DelaySeconds = .5;
var LastTime = new Date();
function waitDelay(){
// This function returns true if the current
// time is at least DelaySeconds >= to
// global variable LastTime.getTime
CurrentTime = new Date();
if ((LastTime.getTime() + (DelaySeconds * 1000)) > CurrentTime.getTime()){
trace("LastTime was: "+LastTime);
LastTime = CurrentTime;
trace("LastTime is: "+LastTime);
return(true);
}else{
return(false);
}
}
Notice that I have two trace()'s in the "TRUE" portion of the if. If this evaluates to FALSE, nothing should be output.
This is on a button:
Code:
on (rollOver){
while (TheVerse._y > -43){
if(waitDelay()){
TheVerse._y -= 14;
}
}
}
What happens is the items moves across the screen instantly. Trace info shows up and the output is not 500 ms appart. It's much less, here is the output:
Code:
LastTime was: 1001819222355
LastTime is: 1001819222405
LastTime was: 1001819222405
LastTime is: 1001819222405
LastTime was: 1001819222405
LastTime is: 1001819222405
LastTime was: 1001819222405
LastTime is: 1001819222405
LastTime was: 1001819222405
LastTime is: 1001819222405
LastTime was: 1001819222405
LastTime is: 1001819222405
LastTime was: 1001819222405
LastTime is: 1001819222405
LastTime was: 1001819222405
LastTime is: 1001819222415
LastTime was: 1001819222415
LastTime is: 1001819222415
LastTime was: 1001819222415
Any idea what I'm doing wrong?
Thanks,
Why Doesn't This Rollover Scroll Work?
Please can anyone help!! I'm trying to have a rollover scroll which makes the image scroll when the mouse passes over the directional arrows.
But I can't seem to get the image to stop at either ends! anyone know why?
See example: http://www.jchequer.co.uk (this link shows what i'm trying to achieve, and that the left hand side stops but right doesn't!)
oh and one more thing.....will i be able to have links within the rollover scroll? as a type of navigation???!
can you please explain how? do i just include the links within the movie clip?
are there any tutorials anyone knows?
Cheers.
OnPress Doesn't Scroll Continuously
Hello,
My btns don't scroll continuously when I use onPress -
How would I get the scrolling function to repeat itself while the btn is being pressed?
Code:
_global.mainTL = this;
//load an image into the pic clip inside the window clip
//create scrollable clip
mc_win.scrollRect = new flash.geom.Rectangle(0, 0, 300, 200);
//--------------------------------- end initialization -----------------------\
//--------------------------------- code for scrollers -----------------------\
btn_up.onPress = function() {
target = mainTL.mc_win;
var scrollUp = target.scrollRect;
var scrollmax = target._y;
if (scrollUp.y>scrollmax) {
scrollUp.y -= 10;
target.scrollRect = scrollUp;
}
};
btn_down.onPress = function() {
target = mainTL.mc_win;
var scrollDown = target.scrollRect;
var scrollmax = scrollDown.height;
if (scrollDown.y<scrollmax) {
scrollDown.y += 10;
target.scrollRect = scrollDown;
}
};
//--------------------------------- end scroller code -----------------------\
stop();
Cellrenderer Doesn't Refresh Upon Scroll
I'm finding that the only way I can refresh a datagrid containing jpegs, rendered with cellrenderer, is by setting a scroll event on the datagrid, then resizing the column to the same value inside this event's function.
Is this a known problem?
UIScrollbar Doesn't Scroll Through All The Text?
Hi all, I have a small-ish text field with a decent amount of text in it which must be scrolled through to view it all. I've added a UIScrollBar component (using AS3), and it shows up fine and scrolls the text fine, but it doesn't scroll all the way down to the bottom of the text, just a little ways into it. If I use my mouse wheel and scroll the text that way, then scroll bar position indicator suddenly shrinks and then I can use the scroll bar clear to the end of the text. But if I don't use the mouse wheel to do this, I can't use the scroll bar to get to the end of the text. I've tried using the update() method of the scroll bar after filling the text field with it's content and attaching the UIScrollBar component to it. What am I missing here so that I can use the scroll bar to scroll all the way down through the text instead of just a little ways?
Help Scrollpane Doesn't Scroll All Content
I've got something weird going on. I've got news page (news.swf) with the scrollpane component which loads an external swf (newscontent.swf). Both files are in the same directory.
Just added some more text in newscontent.swf (thus making the scrollable area larger), but the scrollpane stop half way. It worked fine before.
The document size of newscontent.swf is large enough to hold the text. And no additional actionscript is used.
Can anybody tell me what I've done wrong, if at all...
Thanks!
|