|
-
kinda auto scrubbing How to?
Hey guys, i know i might not be welcome for some reasons but here i am licking your ass ... so here we go!
I have a modest website .... www.thebeastpost.com ... and all i know about flash was learned by myself with code parts of tuturials (since ppl dont give the exact code...whatever) ..and in this site i have a simple mp3 player.... with a loadbar, playbar and scroller.
The scroller is moved by the mouse and its position defines the position of the song...the playbar moves alone and also follows it foward and backwards...welll... i took almost 5 days to figure out this code:
onClipEvent (enterFrame) {
var position = Math.floor(_root.mySound.position/1000)
var duration = Math.floor(_root.mySound.duration/1000)
scroller.onPress = function (){
_root.mySound.stop()
startDrag("scroller", true, 0, 0, 300, 0)
scroller.onRelease = function (){
stopDrag()
var cue = Math.floor((scroller._x*duration)/300)
_root.playbar._width = scroller._x
_root.mySound.start(cue, true)
scroller.onReleaseOutside = function (){
stopDrag()
var cue = Math.floor((scroller._x*duration)/300)
_root.playbar._width = scroller._x
_root.mySound.start(cue, true)
}
}
}
}
now the question is:
when i scroll, the scroller mantains the same positions and what i wish is when i press another play button of the player it makes the scroller comes back to 0 position...cause what is happening is that the scroller appears in the same position that was left in the last song played..... remember that this scroller is not "auto-moveable"...just moves with the mouse.
Everything works fine .... even when the scroller is in the end of the bar (300) and i start playing another song and move it, it defines the tempo correctly for the new song but i would like it to rollback automaticaly when i push another play button....
any help?
Thank You!
Duarte v.
Last edited by Alienoiz; 02-21-2012 at 05:51 AM.
-
Prid - Outing
The movieclip the scroller is in, presuming it is called, scrollArea, use this code when you push a button:
Actionscript Code:
scrollArea.scroller._x = 0;
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
 Originally Posted by Nig 13
The movieclip the scroller is in, presuming it is called, scrollArea, use this code when you push a button:
Actionscript Code:
scrollArea.scroller._x = 0;
hi, tkx for reply but i dont have an area for the scroller.... im confused...the scroller is just a graphic turned to a movieclip.. what do you entend for the scroller area? sorry my ignorance!!!!!
what happens here is that my scroller._x is located at _x+234 (dunno why cause i set it up to 234 at original position whne i inserted it) and when i set it scroller._x= 0, it just turns - 234 then the actual position... wait im gonna try scroller._x = 0 + 234 
Tkx
Last edited by Alienoiz; 02-21-2012 at 01:03 PM.
-
no does not work..after i move it i can set it scroller._x = 0 but like i said it gets - 234 then the position where it starts at first time but if i put scroller._x = 234 it just does not moves and 234 is the x position on properties....
-
Prid - Outing
Code:
onClipEvent (enterFrame) {
This is how your code starts, meaning that you have this code on a Movieclip, and this movieclip has the scroller Movieclip in it. What is this main movieclip's instance name, and where are the buttons located? Are the buttons located in this main movieclip, or outside?
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
no...the scroller is the movieclip..the enterframe belongs to the scroller actions code
-
sorry i gotta go sleep, i dont sleep far 30 hours....if you reply, we´ll keep with the convo tomorrow...
Tkx!
-
Prid - Outing
post FLA file with the scroller, and ONE button on TinyUpload
30 hours, wut O_O?
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
yeah sure..the fla file...wich is my entire website! so...i give you my website in trade of a simple info (cause im sure that is simple, i just dont have studies) that you probably wont give me.....cammon man....
-
Prid - Outing
trust me, I am not here to steal FLA files or information from others, I simply want to help you, lol. Besides, I hate stealing others work, and when I see something I like, made by someone else, I try to recreate it by typing my own codes in Flash, because I like to be original, lol :P
anyways, I was merely telling you to extract the sound loader and ONE button, and paste them in a new FLA file, and send me that, NOT the entire website :P
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
OK...you can download from http://www.thebeastpost.com/PRG/OK.zip
theres a track i made included thats why is so big lo0l.... anyway, you will not see the playbar moving along with the scroller...i dun why but only works online...to see this you can check in the site www.thebeastpost.com ... go to Music secion...
-
Prid - Outing
yeah, I was right, it was the code in my 2nd post. By scrollarea, I meant the scroller movieclip, because you have a Movieclip called scroller, and another Movieclip inside with the same instance name, scroller, so on your on(release) part of your buttons, simply use this code:
Actionscript Code:
scroller.scroller._x = 0;
Try and elaborate as well :P
Hope this works nonetheless
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
of course you were right...you just wanted to gamble a bit...dun worry im used to it but of course and as to anybody else it irritates a guy ...anyway now i have another problem...my loadbar seems not to get into 0 when i load the movie... but on the portuguese version it does it right.... the code i have in the frame actions is this:
stop();
removeMovieClip(temp);
loadbar._width = 0
setProperty("tf", _visible, "0");
playbar._width = 0
song.text = ""
setProperty("scroller", _visible , "0")
tkx by the help for the scroller..its apreciated
-
solved..was a question of position i think???!!!
much thanks for your help but i believe you dont need to joke a guy to give him some help...i dont take you wrong.... but im a kinda serious guy...i dont like to be pushed into schemes and stuff...
Thanks again and Regards:
Duarte V.
-
Prid - Outing
joke? I am really at loss right now, what do you mean?
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
well...i gave you all code, you "asked" if the movieclip had an area, i told the scroller was the movieclip, you ask for the fla file and give me the same solution than before....so i wonder if you have all the code and you know that the movieclip is the scroller and that the all code belongs to the scroller...why the hell did you needed the fla?
forget it...im thankfull for your help despite of not having much visitors to my site lo0l...keep it up and thanks again!
-
Prid - Outing
that's because I guessed what elements you were using, because it's normal to make a movieclip with all the scroller functions, and inside it, all the associated scroller objects, and since you were using onClipEvent(enterFrame), which is used on Movieclips, I knew that you that the scroller movieclip which you drag, was inside a Movieclip but not on the same level as the play/stop buttons (trust me, I have experience), so I thought that the Movieclip you put the onClipEvent(enterFrame) code on, had the instance name of scrollArea, but I was wrong, and inside it, you had the scroller draggable Movieclip itself, given the instance name scroller. Then you mentioned that the Movieclip I thought was named scrollPane, was called scroller, so I got confused, because then I thought that in the onClipEvent(enterFrame) code, by using scroller, you referred to the clip itself, how should I know that both of the Movieclips would have the same instance name, scroller? That part confused me, and since I didn't have access to your FLA file structure, there'd be no way I would've guessed that myself without looking at your structure. Besides, my first code should've given you an idea of what I was trying to tell you, to move the X coordinate of the draggable scroller movieclip to 0, which is the starting X coordinate in that Movieclip, to turn it back.
Anyways, good that it's sorted out
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
ok ...i sorry....realy!...im just a guy who learns by himself and with pieces of codes that can find in internet, i dont even am used to use forums for this.....so..what do you expected... i understand nothing about this.... anyway... i was trying to get my scroller moving too ( and i can by putting in play button scrooler._x = mysound.podition/mysound.duration*300) but when i drag it it just moves foward then it should be.... like...it brings the playbar into the right position but the scroller gets some setps ahead.... dunno why???!!!!
do you have any idea?
Tkx!!!
-
Prid - Outing
Then I suggest you try and learn on the internet, it's SO easy to get started 
as for your problem, could you explain further, I didn't really get what you meant
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
if i put this:
scroller._x = Math.floor(mySound.position/mySound.duration*300)
on my play button the scroller moves like my play bar, but when i drag it it gets further that the playbar.
why?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|