Topic: problems editing .as file and caption following image

I've looked through all the posts for the last 6 months and though I've found folks with similar issues, none of the ideas have helped me with my issues.

First, I'm trying to have the caption dynamically positioned (for different image sizes) somewhere around the lower-left corner of the image. I can get it close, but it completely mucks up the title position and it's not close enough
!

Second, I can edit the StageManager file once and it seems to take effect. Thereafter nothing I do changes it. I have to delete the whole directory and re-extract it from the zip.

I'm on XP using Flash 8 and have the latest SimpleView 1.8.

Please, please help. I fear I may need to return this software.

Thanks so much,

Kind regards,

-raymond

Re: problems editing .as file and caption following image

Watusee, does SV Pro function as described? If not, I'd certainly rattle Felix' chain.

But if so, on what merits would you return it? (Your temporary inability to adjust the program to your liking isn't a solid reason, IMHO.)

Having to

delete the whole directory and re-extract... from the zip

sounds like something's wrong with your workflow.

E.g. if you had more than 1 copy of viewer.swf, say one in your simpleviewer_proweb folder and one in a "project" folder, and you were accidentally viewing the latter one each time you republished. It happens.

I'm not telling you that's what you're doing, just pointing out it's easy to view the wrong file a few times, swearing you'd made changes but never seeing them.

As far as the customization you'd like, could you describe it in more detail, please? Are you liking to anchor the caption so it always displays a fixed distance from the bottom left of the image?

Re: problems editing .as file and caption following image

tigerstare,

Thank you for taking the time to reply. I guess for me the point of purchasing SV is to save me the time and effort of making this app from scratch. I've been experiencing two issues and as I mentioned spent quite a lot of time (hours) investigating the forums looking for answers and experimenting with the content in various postings before posting myself. While I did find posts that seemed relevant to my issues, I could not come to resolution based on the information in these posts.

I am disappointed because I posted to this forum as well as sent a polite e-mail directly to Felix with no response on either front. I'm not sure what else to do at this point, but I'm feeling like no support means I need my money back. If I can't use the product as is and there is no support, why pay for it? Perhaps my sentence:

"I fear I may need to return this software"

came off as an insult or challenge. That was not my intent and I apologize to Felix if it came across that way. It was intended as a desperate plea for help!

I really like SV and want to use it in the worst way, but if the creator won't work with me, I'm not sure where to go with it.

I'm very open to suggestions, but I'm sure you can understand the combination of the two issues I'm experiencing make it pretty much unusable for me.

I hope someone willing to help!

kind regards,

-raymond

Re: problems editing .as file and caption following image

tigerstare,

Apologies. I neglected to answer your question at the end of your post. Yes, exactly. I'd like to have the caption anchor left-justified some small distance below the image. Ideally I'd like it to dynamically adjust for images of varying heights.

Thank you again for posting a reply and offering to help. Very much appreciated.

kind regards,

-raymond

Re: problems editing .as file and caption following image

Hi,

there are 2 solutions for moving the caption below the image:

1: (Easy Solution) - give the caption a fixed position under the image. Use the fixedLayout AS option. Set your captionX and captionY options to the required location.

2. (More complex solution) - have the caption position move as the image size changes so that the caption is always a fixed distance from the bottom of the image.

Make the following changes to  the source code using a text editor.

In StageManager.as, add this function at the bottom (above the last close bracket):

public function setCaptionPosition(x,y){
    mCaption_mc._x = mImageArea.xpos + x;
    mCaption_mc._y = mImageArea.ypos + y;
}

In StageManager.as, comment out the following 2 lines (lines 249+250):

//mCaption_mc._x = thumbX;
//mCaption_mc._y = thumbY + mThumbArea.height +mThumbArea.navHeight + Thumb.padding;

In Image.as, add this line at the bottom of the resizeImage() function (line 201):

mStageManager.setCaptionPosition(imgX - fw, imgY + imgH + fw);

And finally, in ImageArea.as add the following two functions at the bottom (above the last close bracket):

   public function get xpos():Number{
      return mClip_mc._x;
   }
   
   public function get ypos():Number{
      return mClip_mc._y;
   }

Republish the SimpleViewer SWF.

Felix Turner
SimpleViewer Support Team.

Re: problems editing .as file and caption following image

Very close. Getting an error on the function we added. It doesn't like the ._x and ._y property names for mImageArea.

I took a shot at fixing it myself, but was unable to figure it out.

Any thoughts?

Thank you Felix!

Re: problems editing .as file and caption following image

All,

Here's what I did based on the generous advice of Felix and it works like a charm.

In StageManager.as, add this function at the bottom (above the last close bracket):

  public function setCaptionPosition(x,y){
    mCaption_mc._x = mImageArea.xpos + x;
    mCaption_mc._y = mImageArea.ypos + y; 
  }

In StageManager.as, comment out the following 2 lines (lines 249 - 250)

//mCaption_mc._x = thumbX;
//mCaption_mc._y = thumbY + mThumbArea.height +mThumbArea.navHeight + Thumb.padding;

In Image.as, add this line at the bottom of the resizeImage() function (line 202)

mStageManager.setCaptionPosition(imgX - fw, imgY + imgH + fw);

and finally in ImageArea.as add the following two functions at the bottom (above the last close bracket):

    public function get xpos():Number{
        return mClip_mc._x;
    }
    
    public function get ypos():Number{
        return mClip_mc._y;
    }

This solution finally works and works well. Much thanks to Felix and others for their time. I hope this helps others as I've seen this feature oft requested on the forums. This is written for version 1.8 of SV pro.

best,

-raymond

Re: problems editing .as file and caption following image

Thank you, Raymond. I'm certain this will help others.

Re: problems editing .as file and caption following image

I appreciate the detailed info here a lot!  I just have a question.  I have the Pro version, but I'm only using the files located inside the web folder.  I'm using the buildgallery.php to actually create the gallery.  If I were to edit these files, where would I then place them on the server to make them work?

Re: problems editing .as file and caption following image

Hey,

I managed to change the code as outlined above and got the captions to go right under the image, but I REALLY want them on the right side of each image. Where do I need to change that code?
Also, how can I insert line breaks into the captions?

Thanks in advance for your help, I am quite excited about this gallery!
Mimi

Re: problems editing .as file and caption following image

I tried the code by watusee and it works great with the following exception: long captions still wrap based on the width of the thumbnail columns, not the main image. How can I edit the code by watusee to wrap the caption to the width of the main image?

Thanks in advance.

Re: problems editing .as file and caption following image

I'm so confused I tried to make the changes to the code that were specified above but I c an't find the code that needs commented out on line 249 and 250 or in the StageManager.as at all.

Why?

Re: problems editing .as file and caption following image

watusee wrote:

Second, I can edit the StageManager file once and it seems to take effect. Thereafter nothing I do changes it. I have to delete the whole directory and re-extract it from the zip.


I am having the same issue. Was able to make a few changes to ImageArea.as, but now it is stuck on that change. It seems to have been cached somehow. Even deleting the files and restoring them from the original downloaded copy is not working. I know it is the right file I am using - get this:
If I delete the file itself, it will not work.
If I put the file back, but delete all the code out and save it (an empty file) it works as if the code was still there.

?????? I Can't figure it out. ??????

Re: problems editing .as file and caption following image

Check to see if you are getting any errors when you publish the SWF. If your new code contains compile time errors, the new SWF will not be created.

Felix Turner
SimpleViewer Support Team.

Re: problems editing .as file and caption following image

Hello Felix

I really enjoy the product. I turned on 3 of my photographer buddies to it and they purchased the Pro version as well. I am having a little problem with captioning room like the others in the post (AP style captions tend to get a bit long) and the dynamic captioning sounds like the trick. I added the codes in the places specified places and got the following compile errors

**Error** /Users/zgoodwin/Desktop/simpleviewer_pro/source/com/airtightinteractive/apps/viewers/simpleViewer/StageManager.as, Line 303: There is no property with the name 'xpos'.
     mCaption_mc._x = mImageArea.xpos + x;

**Error** /Users/zgoodwin/Desktop/simpleviewer_pro/source/com/airtightinteractive/apps/viewers/simpleViewer/StageManager.as, Line 304: There is no property with the name 'ypos'.
     mCaption_mc._y = mImageArea.ypos + y;

Total ActionScript Errors: 2,  Reported Errors: 2

Just to step through what I did, I added the setCaptionPosition  to line 302, I commented out mCaption_mc on line 250 and 251 in StageManager.as, I also added the mStageManager.setCaptionPosition class (are they called classes in AS?) at line 201 inside the resizeImage function as well as added the last two gets from watusee's tutorial.

Any help would be appreciated, this is the last bit I need to put it into full production use.

Re: problems editing .as file and caption following image

Looks like you are missing the 2 gets in ImageArea.as

Felix Turner
SimpleViewer Support Team.

Re: problems editing .as file and caption following image

Thank you very much, that is exactly what I was missing. I put the gets in the Image.as instead.

Re: problems editing .as file and caption following image

You guys are not alone, i followed the code to the letter and unfortunately have exactly the same two error msgs as you - ie with the x and

**Error** C:WEBxxxStageManager.as: Line 303: There is no property with the name '_x'.
        mCaption_mc._x = mImageArea._x + x; 

**Error** C:WEBxxxStageManager.as: Line 304: There is no property with the name '_y'.
        mCaption_mc._y = mImageArea._y + y; 

Total ActionScript Errors: 2      Reported Errors: 2

i'm pulling my hair out over this one, so if anyone has figured out a way, please let us know.

cheers!
roll

Re: problems editing .as file and caption following image

initially, i did as felix suggested with the last stage of watusee, but this had the same error.

if anyone is reading this, simply do just as watusee has described.... somehwhere there is a subtle difference, as i merely pasted over what i'd already done with watusee's verbatim and it worked a charm

many thanks to all

you guys rock!

Re: problems editing .as file and caption following image

i'm making changes to the source files and keep getting the following error -

**Error** /Users/rglass/Desktop/simpleviewer_pro/source/com/airtightinteractive/apps/viewers/simpleViewer/StageManager.as: Line 297: Attribute used outside class.
         public function setCaptionPosition(x,y){

Total ActionScript Errors: 1      Reported Errors: 1

what does this mean? i followed the source code provided in this discussion, but it doesn't seem to be working.

PLEASE help!

thanks!

Re: problems editing .as file and caption following image

Hi, me again....

I'm getting really frustrated by not being able to figure this out.

I was able to get the caption under the large image, however, it needs to be dynamically placed to match whatever image is being loaded. Right now, the caption is appearing in the same place for all images, despite the size.

What I need to figure out (I think) is how or what I need to add to comment out the info in the Image.as file.

In this thread it says:

In Image.as file, add this line at the bottom of resizeImage() (line 204):
Code:
mStageManager.setCaptionPosition(imgX - fw, imgY + imgH + fw);

First off, line 204 in the Image.as file, I don't see resizeImage() to add the  above code. And secondly, do I need to add attributes to the following code?

Please help, I'm getting really desperate...

Much appreciated. Here's an example of what I'm doing

Re: problems editing .as file and caption following image

Hi guys,

sorry for the confusion on this subject. My first post in this thread gives the full instructions on how to make the caption always be at bottom-left of the image. I have updated the post to make it clearer.

- Felix

Felix Turner
SimpleViewer Support Team.

Re: problems editing .as file and caption following image

Hi

I changed

mCaption_mc._y = mImageArea._y + y;

in

mCaption_mc._y = mImageArea.ypos + y;


but i have a problem.. The caption is split on more lines even if  the image is larger.. Can you help me?

Re: problems editing .as file and caption following image

Hi guys,

sorry for the confusion on this subject. My first post in this thread gives the full instructions on how to make the caption always be at bottom-left of the image. I have updated the post to make it clearer.

- Felix

I cannot get this to work please help.

Re: problems editing .as file and caption following image

I cannot get this to work please help.

Can you give some more details on what error you are seeing?

Felix Turner
SimpleViewer Support Team.