Flash movie control

Hi ~
I’d like a flash movie to start playing when I hit a button (the logo), but not when the page loads. The movie would appear over the Freeway content and since I would have the swf file set to mode: transparent, I would be able to see the Freeway content underneath. I could place the movie in Freeway, and then set the first frame with a stop action and no content, and then a play action on the second frame, but how do tell Freeway to movie to the next frame in Flash? … or maybe there is a better way to do this all together.

I’m drawing a blank.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Well I’m pretty sure that you aren’t going to be able to do things this way unless someone whips out an Action pack or coding bonanza for this to be done in Freeway. I could see a few Quicktime ideas, but then you’d lose your transparent idea…interesting.

Perhaps someone else can chime in. Perhaps a lightbox method on pageload somehow or a pop-up window when the site loads, but most people have those blocked because they’re annoying.

Maybe another method perhaps?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’d like a flash movie to start playing when I hit a button (the
logo), but not when the page loads.

Can you put the trigger button within the Flash movie? That would
save you a lot of headaches.

k


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

This sounds like the logical thing to do, but I just haven’t figured out how to execute it. Would anyone happen to know how to trigger a Freeway button to start a Flash movie?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

What Keith is suggesting here is that you incorporate the “start” button in the Flash movie itself, not that you try to start it using a native form control or graphic button from within the Freeway designed page.

If you want the start button to appear to be outside the movie space itself, you could always make the Flash canvas invisible, and have a visible “frame” where the movie plays. Then your button (while technically within the same movie) would appear to be separate, and could start the movie in the usual “click to play” manner.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Here’s a bit of JavaScript if you want to start and stop a Flash movie using an element outside of the movie:

http://www.permadi.com/tutorial/flashjscommand/

It actually looks pretty simple, but only if you understand JavaScript I suppose.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thank you! The tutorial looks easy enough to follow. I’ll read through it and try it out and let you know how it works out.
You guys are great.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter,
I got a bit lost in the link you sent regarding the javascript …
but I think I might be able to do this from another post you responded to on May 8 “Adding Javascript to an Item”:
( ref: http://www.freewaytalk.net/thread/view/32512#m_32513 ).

I want the logo (graphic item) when clicked to play a Flash movie called “movie-ball.swf”. The first frames of the movie are blank, the animation fades from 0% to 100% alpha and then fades back out from 100% to 0% alpha. It’s just a little logo teaser, although it will cover most of the page’s content when playing.

Does it make sense to add a hyperlink to the graphic logo with “javascript:” as the url… Extended…New:
Name “onClick()”
Value "function getFlashMovieObject(movie-ball.swf)
{
if (window.document[movie-ball.swf])
{
return window.document[movie-ball.swf];
}
if (navigator.appName.indexOf(“Microsoft Internet”)==-1)
{
if (document.embeds && document.embeds[movie-ball.swf])
return document.embeds[movie-ball.swf];
}
else // if (navigator.appName.indexOf(“Microsoft Internet”)!=-1)
{
return document.getElementById(movie-ball.swf);
}
} "

How would it position itself on the page, though?

thank you, Rebecca


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You need to put the function in the head of the page, inside a script block, and then just call that function later on down the page. So up in the head of your page, put:

<script type="text/javascript">
function getFlashMovieObject(theMovie){
    if(window.document[theMovie]){
        return window.document[theMovie];
    }
    if(navigator.appName.indexOf"Microsoft Internet") == -1){
        if(document.embeds && document.embeds[theMovie]) return document.embeds[theMovie];
    }else{
        return document.getElementById(theMovie);
    }
}
</script>

To add this code to the head of the page, select Page > HTML Markup from the main menu, then change the Position picker to “Before /head”.

Then, down in your page, you would apply the following link to the button:

href: javascript:;
onclick: return getFlashMovieObject('movie-ball.swf').Play();

That should do the trick, although I may have made a typo. The best way to spot that would be to try running it in Firefox with the Firebug extension installed and enabled.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

One more thing that might not be immediately obvious from my example code – the way I have written this makes it possible to use the same code over and over on the page, so that if you wanted to have start AND stop controls, or if you wanted to show more than one movie on the page, you wouldn’t have to roll up the same function over again with different variables in it. You make the function generic, then pass it a variable so it knows which movie you are looking for.

So you could have buttons for more than one movie:

return getFlashMovieObject('movie-ball.swf').Play();
return getFlashMovieObject('movie-block.swf').Play();

Or start and stop:

return getFlashMovieObject('movie-ball.swf').Play();
return getFlashMovieObject('movie-ball.swf').StopPlay();

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter,
Would you mind looking at my code on the beta site here:
http://www.fonsecadesign.com/magbeta1/. (I’ve applied it just to the index, or first page for now, but later I will apply it to the master pages).

I get a message that href: is not an acceptable protocol.
Sorry for the bother, but once I get this down, the info will be useful for so many other projects, and hopefully, other Freeway users. Thanks, Rebecca


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Sorry, I think you took it just a little too literally. I was trying to indicate with text what field you should fill in, so the href attribute would get the value ‘javascript:;’ (without the quotes).

So open the Hyperlink dialog for your button, click into the Extended side, and then in the large field at the top, enter

javascript:;

That’s all. Sorry for the confusion.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter,
So, I clicked on the graphic, chose ‘hyperlink’ (command K),
External protocol “javascript:”, extended tab, new, name = “javascript:;”, value = “onclick: return getFlashMovieObject(‘movie-ball.swf’).Play();”

My page markup before is ""

I’ve uploaded the movie-ball.swf to the site with the “Upload Stuff” action, and chose to upload it to the location where the html files reside. I also placed the swf file in a html box with the first frame in the swf file as stop().

But so far, nothing is happening. Am I doing something wrong?

Rebecca


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Almost there. In the hyperlink dialog, External protocol “javascript:”, in the big link field, just enter a single semicolon. This will make the link read “javascript:;” when it’s published. In the Extended tab, select your javascript property and press Edit. Change it to read thus:

In the Name field, enter ‘onclick’ (without any quotes).

In the Value field, delete "onclick: " so that it reads only

return getFlashMovieObject('movie-ball.swf').Play();

Publish again, and you should be set.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter, I’m sorry, I had to jump and finish off two projects before I continued on with the javascript - Flash issue.
I was messing around with it this weekend, but I’m still not getting it to work, so if you happen to have an opportunity to look at it, that would be great. I have everything set-up as discussed above (graphic links to hyperlink). Flash movie is placed on page with html box. I even have the ‘upload stuff’ action uploading the swf file. The first action frame in my Flash movie is stop(), and the next one is (play). Perhaps I have done something incorrect (or haven’t done anything at all with the ‘ID’ name. I don’t know what or where you would set that. When I hit the company logo to fire the flash movie, nothing happens.

http://www.fonsecadesign.com/magbeta/
(it’s set-up just on the homepage right now)

thank you for all you help, Rebecca


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

There’s a typo in the script at the top of the page:

 if(navigator.appName.indexOf"Microsoft Internet") == -1){

should be

 if(navigator.appName.indexOf("Microsoft Internet") == -1){

Also, this entire block of script needs to be in the HEAD, not before
the HEAD starts. Cut everything to the clipboard, then change the
picker in the bottom-left corner of the HTML Markup dialog to read
“After HEAD” or “Before /HEAD” and paste it all back in there.

It looks as though you have everything right in your function call
except for the link. When I look at your published page, I see

 a href="javascript:%3B" onclick="...

If you can somehow change that to javascript:; (the word javascript,
a colon, and a semicolon all in a row) then this should just work.

Walter

On Sep 22, 2008, at 2:47 PM, rebeccintosh wrote:

Hi Walter, I’m sorry, I had to jump and finish off two projects
before I continued on with the javascript - Flash issue.
I was messing around with it this weekend, but I’m still not
getting it to work, so if you happen to have an opportunity to look
at it, that would be great. I have everything set-up as discussed
above (graphic links to hyperlink). Flash movie is placed on page
with html box. I even have the ‘upload stuff’ action uploading the
swf file. The first action frame in my Flash movie is stop(), and
the next one is (play). Perhaps I have done something incorrect (or
haven’t done anything at all with the ‘ID’ name. I don’t know what
or where you would set that. When I hit the company logo to fire
the flash movie, nothing happens.

http://www.fonsecadesign.com/magbeta/
(it’s set-up just on the homepage right now)

thank you for all you help, Rebecca


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

This tip is spot-on for what I need to do. However, when I create the link via javascript, the semicolon gets converted to “%3B”.
So, my link should read: "a href=“javascript:;” but instead appears as ""a href=“javascript:%3B”
I have turned off email hiding. Is there something else I need to do?
Kevin


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You’ll need to remove the semi-colon (still valid). Freeway is sightly over zealous in its encoding. Alternatively, enter a dummy link in the Hyperlink dialog (a space character will do) and then override it with an extended attribute (click Extended in the hyperlink dialog and add href as the name and javascript:; or javascript:return false(); as the value).

Joe

On 11 May 2010, at 19:53, Kevin G wrote:

This tip is spot-on for what I need to do. However, when I create the link via javascript, the semicolon gets converted to “%3B”.
So, my link should read: "a href=“javascript:;” but instead appears as ""a href=“javascript:%3B”
I have turned off email hiding. Is there something else I need to do?
Kevin


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks for clearing that bit up. I think I’ve followed the tips here but it still isn’t working. Would you mind looking at the page to see what I’ve missed?

http://offair.ccshare.tv/TOSH_TEST/tosh.html


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options