Flash Button

Page: 1

Author Post
Member
Registered: Apr 2009
Posts: 19
Hi,
I dont have skill to flash language and have to create a movieclip with the code to load the FB
I try
mybtn.onRelease = function ()
{
getURL("javascript:fb.loadAnchor(\'images/psup.jpg\')");
};

but it do not work, I have to use the import command to include same componets in flash code??
like
import flash.display.Sprite;
import flash.events.*;

tks
Member
Registered: Apr 2009
Posts: 19
Or if you have a simple .fla with an example, it will help a lot...
regards
Member
Registered: Apr 2009
Posts: 56
@Walter

Try the following.

Walter Oliveira wrote
Hi,
I dont have skill to flash language and have to create a movieclip with the code to load the FB
I try
mybtn.onRelease = function ()
{
getURL("javascript:fb.loadAnchor(\'images/psup.jpg\')");
};


1. Delete "\" from your call to retrieve 'images/psup.jpg'

2. Your function is completed with the right curly bracket "}"
So, delete the ";" following the final right curly bracket "}"
<admin: Actually, the presence of ";" is correct. It terminates the assignment statement, not the function block, just as if you had "onRelease = 42;". But the interpreter is forgiving and the statement will work with and without the terminator.>

Try it like this:
mybtn.onRelease = function()
{
getURL("javascript:fb.loadAnchor('images/psup.jpg')");
}

This code is tested and working fine here in Flash CS3. See additional input below about your preference settings and other matters using Flash.

Walter Oliveira wrote
I have to use the import command to include same componets in flash code??
like
import flash.display.Sprite;
import flash.events.*;


3. Try it without using these import commands.

4. Be certain that you have defined an "Instance Name" for your button in the Properties Panel of Flash. You must assign the Instance Name exactly as you have typed it in your code. The Instance Name is case sensitive, so make it exact with "mybtn" (without the quotation marks).

5. "getURL" calls are only supported in Actionscript 2. The call will fail if your settings in Flash are set to Actionscript 3
So, if you are using Flash CS3 or CS4, you must insure that you back-save your original FLA file to the Actionscript 2 format. By default, CS3 & CS4 will automatically save your file to Actionscript 3 format if you do not choose the optional Actionscript 2 setting when saving or exporting your final .SWF The option is presented to you when you try and save your FLA. Look for the lower dropdown box when you save your file. Also, check your export setting preferences when you export to the final .SWF

6. Be certain that you have downloaded the latest Floatbox version. Over the past couple of weeks, I do believe there are some changes/fixes in the code that affected Flash. If you downloaded Floatbox many weeks ago, get the new version.
« Last edit by admin on Fri May 01, 2009 2:06 pm. »
Member
Registered: Apr 2009
Posts: 19
@JATSS

Bingo,

I download the new version .351 and now it works, but the floatbox load by button is loading over the botton. as you can see in the link

http://www.wop.com.br/FLASH/FLOAT.HTML

I create a scenario, do you have an ideia about this problem.

tks in advance
Member
Registered: Apr 2009
Posts: 19
Mistery,

this problem just occurs in MOZILA, in IE7 it work ok...

:roll:
Administrator
Registered: Aug 2008
Posts: 3382
Please see posting #8 in this topic.

You need to either set hideFlash to true or change the wmode of your flash to opaque or transparent.
Member
Registered: Apr 2009
Posts: 56
Walter,

Your main issue is with Flash and your understanding how to integrate it to HTML content. Here's a working example explaining what I think you are trying to achieve with your post above.

http://www.japaneseautotech.com/carousel_test/FLOAT.HTML

Please copy the resources on the example above and try it out on your server. This example will be deleted in a week or two. Note that I have made changes in the HEAD area to reflect where the Floatbox Javascript files are stored with my example. The location is different than yours.

Cheers :)
Member
Registered: Apr 2009
Posts: 19
Hi Jatss,
I really appreciate your help, I try and it works fine, in both browsers, Mozilla and IE. Many thanks?
But now I now that it works, and begin in real scenario, I will use this button in a FPP (Flash Panorama Player), that loads .swf using a .xml, as in example of this link

http://www.wop.com.br/flash/float.html

I load the button inside the FPP but the image is not load. I know that FPP does not have relation with this group, but do you have any idea about what it wrong?
Once more thanks for assistance
Walter Oliveira
Skipe: oliwa01
Member
Registered: Apr 2009
Posts: 56
Walter Oliveira wrote
Hi Jatss,
I really appreciate your help, I try and it works fine, in both browsers, Mozilla and IE. Many thanks?
But now I now that it works, and begin in real scenario, I will use this button in a FPP (Flash Panorama Player), that loads .swf using a .xml, as in example of this link

http://www.wop.com.br/flash/float.html

I load the button inside the FPP but the image is not load. I know that FPP does not have relation with this group, but do you have any idea about what it wrong?
Once more thanks for assistance
Walter Oliveira
Skipe: oliwa01


Walter,
Read this post here.

Check your documentation in your Component to find out what version of Action Script it uses.

I could not find your .xml file. You probably need to look at the calls in your .xml file. Insure that your component supports the version of Actionscript used when you export your SWF file. Also, if you are using CS3 or CS4, you can export to either AS2 or AS3. Insure your settings are correct and you are saving the file correctly. By default, CS3 and CS4 will save it as an AS3 file. You need to specifically choose the option to save it in AS2 if your component was written in AS2.
Member
Registered: Apr 2009
Posts: 19
Hi ALL,

I got to solve the links, and other mistery happen,,,,

The code was working correct, and without changes, the error

SecurityError: Error #2051: Security sandbox violation: file:///C:/Repositorio Flash WOP/JSUL/files/hotspots.swf cannot evaluate scripting URLs within file:///C:/Repositorio Flash WOP/JSUL/indexteste.html (allowScriptAccess is ). Attempted URL was javascript:fb.start({ href:'VIDEO/CEA.SWF', rev:'width:900 height:450', title:'CA?A OFERTAS - SHOPPING JARDIM SUL' }).
at global/flash.net::navigateToURL()
at Hotspots/execute()
at Hotspots/executeFunction()
at Hotspots/doHSClick()


any Ideia...I wiil open a new POST about that... :(
Member
Registered: Apr 2009
Posts: 19
I got it.......

I upgrade to 3.52 , and all problem have been solved, you can see in the site
http://www.wop.com.br/jsul/index.html
I know that this is not your native language, but you can see a good interation with imersive panoramic photos with floatbox, just click in all green sphere, or green star in the panos.

thanks in advance, you provide a great support...tks

Page: 1