AS2 fixed sized movieclip - actionscript-2

I'm working with a Flash website at the moment, and when clicking on a specific hotspot, it opens up a new .swf over the top. This .swf it opens is styled similar to a Lightbox. It has a (x) to close unLoad the movie, along with a (<) and a (>) to navigate through the images.
The problem being, when adjusting the explorer window, the flash elements scale to the adjusted size, staying in proportion.
What I want is, while it's in the HTML page, is to have only the background flash image to scale, but to have the overlaying 'lightbox' .swf at a fixed width/height, so it never scales according to the size of the user's window.
I've found an example to help with this:
http://newsletters.plainpicture.com/static/newsletters/com/news-1208/index.html

how is your "lightbox" swf implemented? is it an actual html lightbox that acts as a container for an external swf movie? or it's your coded lightbox inside the same swf website movie?
if it is html lightbox then you must provide information about what kind of lightbox it is and perhaps look into the lightbox documentation.
if it's your "lightbox" inside the same flash movie, a possible way to resize a specific part of the same swf but not another is to publish the movie (inside "publish settings", ctrl+12) as non-scalable, and resize only a desired part of your movie manually- via the resize event on the stage listener
var stageListener:Object = new Object ();
Stage.addListener (stageListener);
orig_ratio=Stage.width/Stage.height;
stageListener.onResize = function(){//resized page
something_to_resize_only._height=Stage.height;
something_to_resize_only._width=something_to_resize_only._height*ratio;
//...etc etc... you may include current_ratio/orig_ratio comparison conditions too
}
if you need help with resizing stuff manually, you should create a new question as it is something irrelevant to this question. don't be afraid though, it's not a difficult task and you may even find a lot of tutorials on proportional scaling/resize

Related

Upload same image in different sizes - Dropzonejs

There is any possibility to upload a file with different sizes in DropzoneJs?
I'm using vue-dropzone which is made with dropzonejs and i have to upload the same file with different sizing for srcset.
Example:
I want to upload the file test.png which is 1000x500 px. There is any possibility to upload it at the same time in original resolution and also in 500x250px?
Image resizing in the browser has been a seat-of-the pants experience for a long time. Web assemblies are the way of the future for processing-intensive tasks in web apps. I came across this project the other day. It looks fantastic and I really can't wait to strip out our home-baked image resizing with canvas and replace it with this.
The usual reason for doing this is to avoid large uploads. It's a little bit weird to want to resize in the browser then upload the original. You might be better resizing on the server. You'll save bandwidth and the server libraries will be more mature than what's available on the client.
Along with the original image object you can add one more your custom resized image to the array of images by using resize config of dropzone. You can do the above on drop event or adddedFile event of dropzone.

Apache FOP - Scrolling in PDF possible?

I'm using Apache FOP to generate a PDF through XML and XSL-FO. I have a cell in my generated PDF that I need to be able to scroll through if the content overflows it. XSL-FO has an overflow="scroll" feature, but based on my research on the topic it seems that Apache FOP does not support this option.
For example, here is a scrollable region in a PDF used by a large CAD company that I need to replicate:
Is there any way to enable this feature in Apache FOP? Is it possible to enable it in the source code (I haven't been able to find a way to do so)? Any other ways to tackle this issue?
No, it isn't possible.
From the FO perspective:
In the XSL-FO Recommendation the scroll value for the property overflow comes from the corresponding CSS2 definition, which includes this clarification:
When this value is specified and the target medium is "print", overflowing content should be printed.
As the PDF output is a print-oriented medium, I read this as a confirmation that FOP is correct in printing the overflowing content.
From the PDF perspective:
In the PDF Reference 6th edition, a search for the word "scroll" returns results referring either to the scrolling bars in the user interface or in interactive forms (text fields, list boxes, combo boxes).
There is not, or at least I could not find it, a "static text object, but with scrolling bars" feature (which is probably sensible for a print-oriented format), so FOP cannot create it in the PDF output file, not even modifying the source code.
A second look at your comment and the screenshot you included made me think it could be an example of the 3D Artwork feature of the PDF format, a feature I didn't know of before (and I still know nothing besides its name). According to the reference:
Specific views of 3D artwork can be specified, including a default view that is displayed initially and other views that can be selected. Views can have names that can be presented in a user interface.
So, I think your screenshot shows the different views associated to a 3D object; it is not a general-purpose feature that could be used to provide scrollable text.
Well, it could be possible ...
It is possible but as far as I know not with Apache FOP. Without seeing the PDF in question and guessing from the screen shot, it looks like a Flash widget inserted into the PDF. This in PDF terms is a RichMedia annotation (requires PDF version 1.7 with extensions) in which you can insert the Flash widget as well as other controlling files (like XML, other images to display, etc.) and relate them together.
AFAIK, only RenderX XEP (whom I work for) supports such RichMedia annotations inserted into PDF via XSL FO through the rx:rich-media-object extension documented here: http://www.renderx.com/reference.html#Rich Media
I believe, the only viewer that supports PDF with RichMedia annotations is Adobe Reader so it is required to view such a file. Here is a sample that includes a few interactive flash widgets, some interactive charts all within a few page PDF that was generated long ago. NOTE: I am sure some of the links in the document do not go anywhere, it was for a trade show many years ago. Remember, you would need to download this file and view in Adobe Reader and have flash player installed to see it function.
http://www.cloudformatter.com/Resources/Samples/RichMedia.pdf
You cannot use common PDF browser-based viewers like Chrome or Firefox as they do not support this type of annotation.
A screenshot of page one here shows an interactive, scrolling widget. Page 4 contains a widget similar to what you show in your example.
Page 4 scrolling widget very similar to your request:
The widget on the last page is created using a scroller SWF that takes parameters that are the images and setup/configuration files that are XML. The RenderX extension object takes these as parameters and embeds all of them in the document for the interactive flash widget so that it is totally self-contai9ned in the PDF. The XSL FO to do this is:
<rx:rich-media-object name="Sample HTML Widget" scaling="non-uniform" width="611.92pt"
height="74.99pt" content-width="scale-to-fit" src="url('rx-scroller\dockmenu.swf')"
transparency="true" activate-condition="page_visible">
<rx:flash-var name="setupXML" value="rx-dock-settings.xml"/>
<rx:flash-var name="contentXML" value="rx-dock-contents.xml"/>
<rx:rich-media-resource name="rx-dock-settings.xml"
src="url('rx-scroller\rx-dock-settings.xml')"/>
<rx:rich-media-resource name="rx-dock-contents.xml"
src="url('rx-scroller\rx-dock-contents.xml')"/>
<rx:rich-media-resource name="style.css" src="url('rx-scroller\css\style.css')"/>
<rx:rich-media-resource name="customer1.png" src="url('rx-scroller\images\customer1.png')"/>
<rx:rich-media-resource name="customer2.png" src="url('rx-scroller\images\customer2.png')"/>
<rx:rich-media-resource name="customer3.png" src="url('rx-scroller\images\customer3.png')"/>
<rx:rich-media-resource name="customer4.png" src="url('rx-scroller\images\customer4.png')"/>
<rx:rich-media-resource name="customer5.png" src="url('rx-scroller\images\customer5.png')"/>
<rx:rich-media-resource name="customer6.png" src="url('rx-scroller\images\customer6.png')"/>
</rx:rich-media-object>
And note that many things that are in the flash would work, like links and such. It is just a pure, interactive flash inserted into PDF as the container.
Indeed it looks like this is not possible to achieve through FOP.
Continuing to dig around for a few days, however, I did find a clever post-processing alternative that is also free, essentially embedding a PDF inside of another PDF using the LaTeX animate package.
A drawback to this method is that it is not possible to embed links inside of the scrollable region, which is a major issue for me. But the method does enable inserting a scrollable region inside of an existing PDF and got me very close to what I was trying to achieve.

Titanium, Can you print a WebView webpage

In Titanium, is it possible to print a webpage, similar to printing a webpage from Safari? I'm using WebView.
It only needs to work with iOS, not Android.
If so, how? I haven't been able to find anything about this. One person told me it was impossible, but I thought I'd ask Stackoverflow - people here often surprise me :)
If you use the toImage() function on the WebView it takes a print to the visible area:
$.webview.toImage();
You want all the html content right?
If not, an possible workaround (I've didn't try this), but in order to do this, you need to know the html document height.
Create another WebView on an lower zIndex of your content app or place it out of the visible area like:
$.webview2.left = Ti.Platform.displayCaps.platformWidth;
Take a print of that copied WebView with:
$.webview2.toImage();
Than remove that view, obviously this wont work for all situations.

Generating a random preview image on a HTML5 video tag

Is it possible to capture a snapshot of a video that's loaded using the HTML5 video element and use that as a preview image until the video loads or the play event is triggered? I know about the poster attribute but I want the thumbnail to be self generated, like a random frame from the video. Sort of what YouTube/Vimeo does.
Thanks,
I don't think that this is possible in pure HTML5. Principally because the stream is not loaded when you see the 'object' in the webpage so the client can't get the desired frame.
However, the best option for you is to save / cache the 'random frame' before loading the page and then use it as the poster of the video. This will allow you to reduce the client work and save the bandwith.
check THIS, which is the first thing that I've found (if you're using PHP and you want a 'quick and dirty' way to get the frame)
Update
Apparently HERE there is a solution with popcorn.js BUT it seems that you can't do it in the way that (I suppose) you need.
This because it would be possible to do this only inside the same domain due to browser security issues.

Plugin: BuddyPress Activity Plus - How can I call the full size image?

I’m using the BuddyPress Activity Plus plugin and wanted to know if there was a way to call the full size image that was uploaded when viewing the single page of the activity?
I’ve looked at placing a line of code in “activity/entry.php” of the child theme but can’t find anything that will call its full size image, only the thumbnail shows with the link to the full size image to open in a lightbox.
This isn’t what I’m looking for, the full size image needs to be in place of the thumbnail when viewing the single activity page.
Any idea anyone? Sorry if this is the right place for this, just having trouble getting an answer
Many thanks
I'm looking to do a similar thing, not too much luck yet. Also - have you noticed that if you upload multiple images, they stack, rather then laying out side by side?
EDIT:
Found out how to make the images in the stream bigger:
You can set your preferred thumbnail size separately from your default thumbnail size settings, if you wish to do so. You can do that by adding this line to your wp-config.php:
define('BPFB_THUMBNAIL_IMAGE_SIZE', '200x200');
Where "200x200" are width and height (in that order), in pixels.
Finally, be sure to verify your default sizes for embedded media. It's in Settings -> Media -> Embeds -> Maximum embed size