[solved] Making .swf hotspots by hand?

  • Hello,

    I am trying to make an .swf hotspots. If I do it in Adobe Flash CS3 and export to .sfw, everything works as expected. But if I try creating a hotspot .swf from scratch, I have a very odd behavior. Here's how I am doing it:

    1. I have a Test.as file:


    Basically, it draws a red circle.

    2. I am compiling it with mxmlc from free flex_sdk and have my Test.swf, which I use as a hotspot:

    Code
    <hotspot name="hotspot1" url="Test.swf" ath="0" atv="0" />

    3. I can see my red circle in the panorama, but it is positioned not at 0,0 location. And, if I zoom in, this circle has a tendency to move from left to right and a bit down. Zooming out moves it leftwards. Do you guys have a sample .as plugin so I can have a look how it is done? I am not a flash developer per se, but this one should be simple, right?

    Thank you.

    Edited once, last by nmakarov (October 14, 2009 at 2:51 AM).

  • Try adding zoom="true" to the hotspot.

    <hotspot name="hotspot1" url="Test.swf" ath="0" atv="0" zoom="true" />

    Also try to open your Test.swf file and see if it is centered on the stage. I encountered both problems when I made my first hotspot. Of course, I used flash and not the manual code so I can't help you fix it but hopefully this will give you some assistance with the zoom issue.

  • if I set zoom="true", it stays at the spot on zoom. Cool. But I do not want my hotspots to be zoomable. When I open the .swf in a browser, it is not centered, so you're right. But I do not know how to place it in the center...

  • Still doesn't work...

    Here's the full code:

    I have even combined both tecniques... Still the same effect...
    Klaus, can you post here a full .as example (as simple as this stupid red circle) so it will stay at the damn spot, so I can compile it with mxmlc and see that it actually stays, please? I'm loosing my hairs over it. I know I am asking just too much, but I do not have many of my hair left, either *smile*

  • Have you cleared your browser cache after each attempt?

    Yes, I did. I even created a new .as hotspot (just in to be sure), compiled it and everything. The same flying dutchman effect. Help!!! Just give me a complete .as example and I will stop crying.

  • In order to save my hair (whatever is left, at least), I spend last two hours in research and finally found the solution. Klaus, there was no need to center the image! The problem was with the canvas size. By default it was something like 800x600, so my circle was in the upper left corner. That's why it moved sideways if I looked straight at the circle. The only line I needed to include in my .as file is

    Code
    [SWF(width="50", height="50")]

    immediately before the class declaration.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!