Integration With Flash

Page: 1

Author Post
netslider
Guest
Is it it all possible to integrate fb within flash..?

If so, how?
netslider
Guest
I see in the readme's that it is absolutely possible to do this.. but how? I tried the code it gives but it just isn't working!

Please help!!
Administrator
Registered: Aug 2008
Posts: 3382
I'm assuming you mean launching something in floatbox as a result of a click action on a flash object. The code suggested in the docs has never been tested (to my knowledge), but seems to be what people on the net agree on. I'm seeing some other suggestions that you need a 2nd parameter to the getURL function. Here's an example:
getURL("JavaScript:alert('eat a peach');", "_self");

Once that is working, the floatbox function you want to run looks something like:
fb.loadAnchor('myHref.html', 'revOption1:value1 revOption2:value2', 'My optional title');
Only the first parameter is mandatory. If you're in an iframe you may need to use parent.fb.load...

If you get this working please let me know. The next version release is in the next one or two days and it would be great to get this part of the docs accurate for that release.
netslider
Guest
Tried everything and I just cannot get it to work. I'd love for you to be able to have working code in your docs :/ Any ideas?! Anyone?!?!
netslider
Guest
on(release) {
getURL("javascript:parent.fb.loadAnchor('yourpage.html', 'width:? height:?')");
}

That works brilliantly

Now ... how might I go about adding in my caption....?
Administrator
Registered: Aug 2008
Posts: 3382
Two ways to add a caption.
The second loadAnchor parameter is where you put options, same as you would on a rev attribute. You've already got "width:x height:y" in there. Add "width:x height:y caption:`my caption`". Or, use the 3rd parameter which is equivalent to an anchor's title attribute. In the absence of a specified caption, the title will be used as a caption.

parent.fb.loadAnchor('yourpage.html', 'width:x height:y caption:`Caption Text`')
...or...
parent.fb.loadAnchor('yourpage.html', 'width:x height:y', 'Caption Text')
netslider
Guest
My bad. I actually did get captions to work as well as outsideclickcloses :) I need to get an img src and ref in the caption as I have done before without the flash... I'm making some leeway I THINK..

Once I get these working, I'll post to this thread and of course, feel free to use it all in the new docs!

Thanks as always for such a wonderful js

Oooh ooh I almost forgot, I can add your link to my site as I promised before. Normally I charge 110 for the year but I am seriously making an exception for you at the price of nada :) I just need a logo from you so I can post one ;)

Thanks again sir
netslider
Guest
Ok, well, i got nothing..

Could you please help?! I'll bet it's something so simple that I just cannot get my finger on.. it's driving me crazy!!!!

Thanks in advance
Administrator
Registered: Aug 2008
Posts: 3382
I forgot how much you like to load the caption up with a page's worth of html. Sorry, I don't want to put time into helping you with that. Some general pointers though: As you know, the caption takes html, but the html needs to be encoded. It probably makes sense to get your html code working the way you want just on a plain page. Then change all the < > & " to &lt; &gt; &amp; &quot;. If you've got any apostrophes (aka single quotes), better encode those too as &#39;. Then drop them into place either in the title attribute or in the caption option. If as a caption option, make sure you surround the whole long string in back-quotes (`). It's finicky work, but easier to the extent you can keep your caption simple.
No, I don't have a logo.
Cheers...
netslider
Guest
Hmm.. so doing it that way in actionscript will be recognized the same as I've already been doing it in pure html...?

Well, I'll try it.

Thanks.
netslider
Guest
Escape html indeed did work... now the only thing I cannot get is.. rel=iframe.1,2,etc... any ideas?!

Thanks once again in advance sir
Administrator
Registered: Aug 2008
Posts: 3382
Indeed, you can't group multiple items together through a call to fb.loadAnchor. That function can only load a single standalone item. So what to do if you need to programmatically launch a floatbox group???

Put an <a>nchor on your page set up to show in floatbox the way you want it to (rel attribute, rev options). This anchor doesn't need to show anything on the page. That is, you don't have to put anything in between the <a> and </a>. But it's probably best to give it some clickable content at first to make sure it works the way you want. Then give it an id, let's say id="glux".

Now you want the actionscript attached to your flash object to launch the click action for this anchor. Two ways to do that...

document.getElementById('glux').onclick();
...or...
fb.start(document.getElementById('glux'));
netslider
Guest
Thank you again sir.

I am having no luck. Driving me crazy it is.

josephst.com/index.html.. please tell me.. where can I place this <a> ?? I swear this is like the last thing I will ever ask of you!!
Administrator
Registered: Aug 2008
Posts: 3382
Maybe I wasn't clear. Where do you place the anchor element? Anywhere you like. In the html of your page. Between the <body> and </body> tags.

What I am suggesting you do is put a standard link on your page and mark it up with the floatbox attributes you want on it. Group it with others by using iframe.1 or however you see fit. The objective is to have an anchor on your page that does what you want when it is clicked.

Then, after that is done, the second objective is to fake a click on that anchor from a click on your flash object. You already know how to invoke javascript from flash, and those two functions I gave you are the javascript functions you can use to fake a click on the anchor you set up.

Now if you can't take it from here based on this twice stated description, I'm afraid you're on your own.
netslider
Guest
i did everything you said but.. nope.. maybe i have the as code in wrong..?

Page: 1