Markart
08-04-2009, 05:11 AM
The player of a SWF file created with CS4 Adobe Air starts suddenly when the web page loads. How can I make it wait and starts when the start button of the player get pressed? Thanks for any suggestion :)
|
Click to See Complete Forum and Search --> : How create Start arrow for swf? Markart 08-04-2009, 05:11 AM The player of a SWF file created with CS4 Adobe Air starts suddenly when the web page loads. How can I make it wait and starts when the start button of the player get pressed? Thanks for any suggestion :) Eye for Video 08-04-2009, 06:36 PM Kind of hard to say exactly without seeing the Flash file but here is a suggestion that may take care of it for you. You may need to translate from AS2 to AS3, but process is the same. Put a stop action in the frame right before all the animated part starts, maybe frame 1, perhaps a background image loads then action stops and waits for button to be clicked..... stop(); Then create a button with the instance name start_btn and create a function to jump to the first frame of animation, labeled "animation". start_btn.onRelease = function() { gotoAndPlay("animation"); } on Release will start the animation part. Best of luck to ya! EfV Markart 08-05-2009, 07:15 AM Hi EfV, Thank you very much for your kind response, I am very much obliged. Certainly there is something wrong with my CS4 project so I cannot add the codes you wrote. The project was originally an .avi file converted with the Encoder into .flv hopping in this way I can add to it what is called the (Playing controls) and a Starting arrow. I have tried 2 methods but non of them was successful. 1) New AS2 project was opened and the newly converted flv was imported to s t a g e and was fixed on Layer 1 in single frame.With F9, the stop(); code once was inserted on the frame but didn’t stop anything. Another time separatly (Layer 2) was created and was put on its sole frame also it didn’t work. 2) New AS2 project was opened and the converted flv was imported with (Flash File Adobe Air) once as [import video…] in order to be exported as flv file with (SkinUnderAll.swf). The result was terrifying that CS4 did not produce 1 separate swf file to be embedded as usual on HTML page but 50 kb swf and the mentioned player swf file and the original 400 mb flv file. Hopelessly, I searched the web for a week or so to find any salvation piece of html code to embed that strange output of 3 files. Till now I do not know how to fix them all 3 on the page to have them worked properly (if ever) showing the dreamed about playing controls and the starting arrow. However, I have tried another player (FLV) to play the flv. Though, it managed to show the playing controls but still; started the play in such clumsy manner without prior note and with an image for marking link on it. Hopping this information help to find rescue for this situation. With my deep thank and appreciation. :) Eye for Video 08-05-2009, 01:13 PM OK, Now I have a little better idea of what you are trying to accomplish (I hope). So you want to play a .flv file and have a start button to start the play, correct? If so, you will need a video player in the form of a Flash .swf file to do so. Almost any good Flash video player will play the .flv file and have controls to stop and start the file. Use the Flash encoder to convert the .avi just like you did. To give you a better understanding of how that all works, I’ll attach a simple video player for you to practice with. This is an educational version that will show you how to code the control buttons etc. Put the .fla in the same folder as your .flv file (rename your video to "video1") and then [control] [enter] to test. The player is set to paused currently so you’ll need to press play to get it started. /* Name of your video, with correct path, goes here */ ns.play("video1.flv"); /* Comment out this pause line for use with auto start or leave pause to start with Play button */ ns.pause();This player also includes code to trace any metadata in the video file. This is often helpful when first testing or working with your video. Once you’ve seen the metadata, you really don’t need to see it again so move the comment tag from line 35 to the end of line 32, then your scubber bar will work. // Trace the metadata then remove the last comment tag from code below // ns.onMetaData = function(myMeta) { for (var i in myMeta) { trace(i + ":\t" + myMeta[i]) } } /* cut the comment tag from line 35 and paste at end of this line so scrubber will work ns["onMetaData"] = function(obj) { duration = obj.duration; } */Remember, you can remove any of the control buttons and/or scubber bar and customize the player as you see fit. This is just for educational purposes, so have at it… skin it with a custom image or whatever. The video player is mainly in the actionscript anyway. Best wishes, EfV Eye for Video 08-05-2009, 01:15 PM Attaching the file might help.....duhhhh. EfV Markart 08-07-2009, 07:40 AM Hi EfV I would like to thank you deeply for your help. Your comments and the cods you wrote patiently were very helpful. I think, you should be very much proud of yourself and your knowledge for your generosity to share it with the others to help who needs such support and especially beginners.:) webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |