Embedding Flash

Thanks. As much help as I’m getting here I’m certainly going to link to kirupa.com. Ah, one more thing. I’ve decided to ditch the frames. With different screen resolutions, browsers and all that they’ve become just too difficult to work with and aren’t worth it. Instead I’ve found out how to create a remote popup window. Only one problem… I want to load the control panel in that… but the control panel is in flash… The page is http://www.javascriptkit.com/script/cut105.shtml
(The one showing how to create the remote window)
Now, I have an idea of how I can do this, but I’m going to ask to make sure as well. How do I make the buttons in my flash control panel do the same function as this link: <a
href=“javascript:remote2(’…/javaindex.htm’)”><strong>JavaScript Tutorials</strong><
/a>

Make your button…

Then the link will become something like…

on (release) {
getURL(“java script:remote2(’…/javaindex.htm’)”)
}

Just theory, but I think that is how it would go. Since Flash does work with Javascript funcitons.

That didn’t work… maybe I did something wrong?

Well the board automatically put a space between the java and script. It should really say javascript (without the space). That could be the cause of the problem.

I figured that and fixed it. Still didn’t work. I’ll try everything once more…

Do you have the javascript functions it calls upon inside the HTML page of your embedded flash movie?

What do you mean? I right clicked the button and chose actions, and I put in what you said, closing the gap between java and script. Then I reloaded it onto the server and it didn’t work. :frowning: I’m gonna feel real stupid if it ends up I made a simple mistake.

Did you follow step 1 and step 2 that they give you on that site.

It has 2 textarea boxes that contain the codes you need to get it to work and what to do with each of those codes.

I put this in the head of the remote page:


<script>
<!--
function remote2(url){
window.opener.location=url
}
//-->
</script>

After that I embed my flash movie, and put in that javascript:remote2 thingie. I’ve put the example links in and they work fine, it’s jus the flash button that isn’t working right…

EDIT: Grrr, it may have been a simple mistake. After the end of the fade in of the button there’s no code on it, so I’m going to insert it there as well. Maybe that’ll work…

Well their step 1 has code that goes on the page that launches the remote. This is required of course.

So if you skipped Step 1’s code you might need to go back to it.

Bingo! That was my problem, after the animation and the button was faded in it had no javascript coding. So therefore it didn’t work. I’m sorry I wasted your time :frowning:

You definitely did not waste my time:)

Glad you got it fixed!

Thanks. I’m glad too. Lol. Anyways, new little annoying bugging problem. Instead of frames I’ve got a remote that loads with certain controls requiring you to login for them. Now, on the homepage is this:


<script><!--
function remote(){
win2=window.open("remote.htm","","width=150,height=350,scrollbars")
win2.creator=self
}
//-->
</script>

Now, I could create a form (as per the example given to me when I found this script) and use onClick=“remote()” but I’m using a flash button. How can I acheive the same effect using the flash button?

<B><I>Edit by lostinbeta: To get HTML to show use the PHP code embed tags (there is a grey button for it above the textbox you type in to reply)</I></B>

The javascript button should say something like

on (release) {
getURL("javascript:remote()")
}

All you need to do is add the javascript part to the beginning. This tells Flash that it is a javascript function and Flash will read the function from your HTML page:)

Oh. Simple then. Lol. Thanks!

That is really just theory since I can’t test it, but I think it should work. I don’t see any reason why it shouldn’t.

It works… sort of. If I go to the actual URL of the home page it’ll work. However when I use a shorter URL that actually forwards me to the page…(darkomnicity.tk) it doesn’t work. I’m lost now. Unless that actually frames my page and messes something up.

In flash if you are making a link to a site and not a page http:// is required.

So it should be … http://darkomnicity.tk/ or http://www.darkomnicity.tk/ (both URLs work, I tried)

I know. What I mean, is if I go to http://angelfire.com/games3/omnicity and then load the remote control, it works. But if I go to darkomnicity.tk instead (which leads to the same place) then the remote control button doesn’t work and the remote window doesn’t load. Instead the same window changes to a page cannot be displayed error.

Hmmm, this could be because of your forwarding address. It seems you have it set to stealth forward am I correct?

What this does is forwards the viewer to your site, but while doing that it encases the original in a gigantic frame the size of the window, and the page you are looking at is actually inside a frame. That way “darkomnicity.tk” can stay in the address bar of the browser without the viewer knowing where your site is from.

That is just theory too. If you want, there is usually an option just for redirections, where if you go to darkomnicity.tk the URL forwarder will just forward it to the mean URL without encasing it in a frame. If you can do this, and this works, then we know the other thing was the problem.