ActionScript 3.0 :: Placing And Sizing External Images
Nov 28, 2011
For some background: I'm creating some e-learning modules using a client's existing Flash/AS/XML template. There is another separate file that is loading XML content and directing the "flow" or progression of the module. Basically, it is broken up into three parts:
1. Chapter = a selection made from a main menu (<chapter> in the XML) and is a large section; it is comprised of one to several "pages"
2. Page = sections within the chapters that users can progress to via navigation buttons; each page represents a separate Flash/SWF file with several clips (driven by audio clips played by another AS file from the XML direction). Also, each page has a certain AS file (only ONE) associated with it to either create interactivity, an activity, or text placement.
3. Clip = audio-driven parts of each page; represented within each 'page' FLA/SWF by keyframes. These modules are being produced for two languages - thus the use of AS/XML to pull in text from two different files. We also have the need to pull in images using AS from the XML files. These images are essentially screenshots; some are large, some are small. Depending on text placement, we may want to resize images to make them fit within a certain space. Can you all suggest the best way to resize/scale these images dynamically. Basically, if the image's width is over 570 pixels or the height is greater than 550 pixels, I want to resize it so it fits within that 570x550 space. You can see the code that I tried (in "//") that didn't work. Feel free to comment on other aspects of the code.
[Code]...
View 3 Replies
Similar Posts:
May 18, 2011
The end result won't matter, once the program is finished (images sitting in IDE or images loaded externally)I work off of a laptop most of the time, cheap laptop, so if I have 5 Megs of images sitting in my Flash IDE, every time I troubleshoot (run the movie, F5), it takes at least 5 seconds before I can test my movie, and when you have to test it 4000 time a day it adds up . If I were to load everything externally, would this knock off the testing time drastically, considering I am not adding the images to the stage (just have them load, and stored in arrays)?
View 2 Replies
Mar 30, 2010
I've set the publish settings to 100% width and 100% height and have then added the 'noScale' function into the first frame of my timeline. Here is an idea of what I'm trying to create:
I have three movieclips that are touching the left side of the Stage and want them to touch the left side of the browser but centre vertically. I can do this by adding the 'Stage.align = LC' command, but not sure if this is the right way to go about it.
The movieclip that is on top contains a logo and I want it to have a fixed size. I called the instance name 'logo_mc'.
The movieclip below 'logo_mc' is called 'container_mc' and is a strip of photographs that I need to run from the left to the right side of the browser no matter what the browser size. I need this movieclip to scale proportionally up and down as they viewer resizes their browser so the first photo is touching the left side of the browser and the last picture is touching the right side (without distorting).
The final movieclip is called 'buttons_mc' and is right below the 'container_mc' clip. This movieclip needs to remain a fixed size.
Obviously when the 'container_mc' clip resizes I need the other movieclips to move up and down to stay the same distance above and below the 'container_clip'.
Example of what I am trying to create: [URL]
View 1 Replies
Oct 22, 2008
I want to put together a flash gallery of photography for my photography business. I am very good at Photoshop design, html, css, javascript but I am a novice with flash. I can use it and use some actionscripting but my knowledge is limited.
I see galleries like this one: [URL]
The images expand and contract perfectly as the browser is resized. I am used to having to size pics for the lowest res screens (I design for 1024 width resos's usually).
What size should I make pictures to work like this... Does flash scale them down / up / either... are there quality issues with letting flash manage the sizing.
View 0 Replies
Sep 23, 2009
i have a working clip of for aligning to bottom right corner of of stage, and i want it to be loaded in from another swf... swf loads fine etc, just when it loads it the MC in question does not move at all?
Code:
Stage.align = "TL";
Stage.scaleMode = "noScale";
var presenter:MovieClip;
[Code].....
View 1 Replies
Apr 6, 2010
I'm designing a website in flash & have imported my images into the library & have placed them on the stage, but when I go to "test movie" to preview my page, some of the images look like this [URL] the funny thing is, when I look at the images on the stage they look fine, it's only when I test my movie that they look cut off.
View 3 Replies
Apr 28, 2010
I've got an array of different sized images. I want to place these images on a canvas in a sort of automated collage.
All my images have heights divisible by 36 pixels and widths divisible by 9 pixels. They have mouseDown functions that allow you to drag and drop. When dropped the image goes to the closest x point divisible by 9 and y point divisble by 36. There is a grid drawn on top of the canvas.
I've sorted the array of images based on height, then based on their widths.
imagesArray.sortOn("height", Array.NUMERIC | Array.DESCENDING);
imagesArray.sortOn("width", Array.NUMERIC | Array.DESCENDING);
I'd like to take the largest image ( imageArray[0] ) to put in corner x,y = 0,0. Then randomize the rest of the images and fit them into the collage canvas.
View 3 Replies
Sep 22, 2011
I'm creating a master movie that will load 4 external swf's. To do this, I made a container of sorts by having an animated screen that rises up. I created an empty movie clip and titled it empty_mc. I dragged it onto the "container screen" which I named movieScreenbut when I press any specific button to load one of the external swf's, they don't maintain the container size, they appear full screen on top of my master movie screen.So, how do I ensure when a button is pressed for a particular swf, that it stays within the confines of the container? To see what I'm trying to do, here is the site:URL...Some of the buttons aren't working yet. However, the Drag and Drop one does for sure...just way out of scale of the container.
I'm just experimenting with how to do this by this code by using loadMovie and loadMovieNum until someone helps me understand what I have to do. I believe I'm supposed to use loadMovie if I want it to be inside a container.[code]
View 0 Replies
Apr 27, 2009
I've got a file that loads 4 external swf files. I've got everything correct as far as how it's listening for when each one is finished loading and then the next one knows to play. So I can get each one to play right after the other just fine. My problem is that they don't all have the same number of frames so in between the movies, there's a blip of a previous movie showing up (atleast I think it's due to varied movie length). I want to put in a removeChild function when it's listening for each movie to finish loading. But when I put in: removeChild(myLoader);, it says myLoader is undefined..
Code:
var a:Array = new Array("movie1.swf", "movie2.swf", "movie3.swf", "movie4.swf");
var iArray:Number = a.length; // number of movies
var iCount:Number = 0;
function manageMovies(){
loadMovie(a[0])
}
[Code] .....
View 1 Replies
Apr 14, 2008
I'm trying to place these external library elements in full screen mode.[code]But I don't know how to make them listen to a stage listener to scale and position relative to the stage size or resize.
View 1 Replies
Oct 17, 2004
I am pulling external images, I have my main image, and five small images, I have that to make the small images when click to appear in the place of the main image, but I am not obtaining to make they to click, I am placing my archive who to want to make download
View 2 Replies
Aug 24, 2009
As shown in the example... I have entered an action to load a movie when I press a button.It works fine but the original swf was made at 800 by 600 when I need it to be 400 by 200.Is there a way to have the video loaded smaller using some kind of width and height line to the command above?I don't want to have to go redue the swf I am loading in...In the swf, I am working on this for class, so It is not finished or have any real sense to it, other than what is required by the teacher
View 5 Replies
Oct 21, 2009
I'm adding text to a movieclip as you can see below. The text is alomost not visible because it's so small. If I don't scale the movieclip then the text becomes clipped. I basically want the movieclip to be a tight container (the same size as the textfield) for the Textfield. The below does not work. How can I do this?
[Code]....
View 1 Replies
May 21, 2010
give me any leads as to the methodology behind a flash feature that senses browser size and sizes itself accordingly.
View 1 Replies
Nov 5, 2010
I have a flash document that I want to always take up the entire web page. Setting to 100% width & 100% height doesn't do the trick, because if the window dimensions aren't right, white space will show on the sides/top and bottom.
Is there a way to get the window dimensions are say if window height > window width : flash movie = window height (and vice versa)?
[Code]...
View 1 Replies
Oct 25, 2011
When using HTML and CSS you can automate the size of an "area" of the page an "area" is classed as a DIV and you automate it by setting its height and/or width to auto (usually height only with width given a fixed size)in adition you can set the DIVs overflow parameter
this is vital for CMS managed websites
does flash have any simple functions for achieveing the same result? or if i used flash with a CMS system would i need use AS3 to calculate the total height and width of all child objects and set this number as the height and width of the pearent object? (with HTML/CSS i would use javascript to do this)
View 1 Replies
Jan 12, 2010
My question today is dealing with a dynamically generated button with a textField.I have the button copy in XML and I need to add a buffer of 10 pixels to either side of the textField. I tried to CENTER my textFormat, but then I could not see my text because the button is for some strange reason 545.45 instead of 88 like it should be. When I change the alignment to LEFT then I can see my text, but still the larger issue is my button size is horribly off.[code]
View 1 Replies
Nov 23, 2011
I'm trying to make an online TCG and I'm starting out by creating the table and card stacks. I've set it up where I have a table which holds stacks. The stacks hold cards, and the cards hold a front and back image. Really simple. So I thought. For some reason, the card is re-sizing to fit the screen. Even though a trace shows that the width and height are correct. Here is an example:n all reality, it should be about the height of the white box with the "A" in it, in the top left hand corner. The only place where I explicitly set a width and height is setting the table width and height. The table, Stack, and card are all sublasses of the flash Sprite class. Since there are 4 seperate files for the example above, if someone would need to look at the code,
View 1 Replies
Jan 26, 2006
i am working on movie clip that will change dimensions ( width and height ) depending on the loaded picture size .I made an easing transformation and works fine.
on (release) {
this.onEnterFrame = function() {
_root.box._width = _root.box._width+(200-_root.box._width)/2;[code]......
I think that it will be much more flashy if I make this transformation bouncy or elastic .I started by searching for tutorials but most of them were about elastic scaling (the shape is changing as one peace )But nothing about sizing , I mean putting a specific value for width and height .
View 12 Replies
Feb 6, 2009
I'm trying to re-size and move a movie clip using my keys, and I can do it, but for some reason, if I set a really low value to "speed", it won't move to the right or down, but it will move to the left or up, even if very slowly.
It is as if flash has problems in advancing very low values on the positive x and y axis.
Add this code to the first frame:
stop();
var speed = 0.01;
var grow = 3.6;
[Code].....
View 1 Replies
May 25, 2011
I only have some background on html and java. I made a website using a actionscript 1.0 template in cs5. I converted it to 2.0 and the mp3 player doesn't work properly with more than one track it was playing all 3 at once. I got it to work with one track messing around with files and coding but the buttons don't function properly. For example when I hit stop it will stop but then play button wont play track and the forward and back buttons don't change the tracks.My other issue is that after finishing my site I realized it wont upload to my host because it 18mb and the limit per file is 5mb. I read that there is a way to break it up into smaller files but I am unsure how to do this.
View 2 Replies
Jul 25, 2011
Is there a way to stop someone from re-sizing pr maximizing the flash application???
View 2 Replies
May 29, 2009
I have a preloader(as3) that is working great, I use FlashVars to pass it what movie it is loading, then it loads that movie, and shows it on the stage after loaded. I would like to make this a bit more dynamic. Right now I can use the same preloader for any movie so long as the movie and the preloader is the same size. I would like to pass the size of the movie im loading to the preloader with flashvars just like im passing it the file path for the movie itself. Here is how im passing the movie:
var swfLocation = this.loaderInfo.parameters.flashPath;
var myRequest:URLRequest = new URLRequest(swfLocation);
now i just access the variable wherever i want to say load the movie
I tried:
var swfHeight = this.loaderInfo.parameters.flashHeight;
var swfWidth = this.loaderInfo.parameters.flashWidth;
stage.stageHeight = swfHeight;
stage.stageWidth = swfWidth;
then in my flashvars i have a value of flashPath=<?=path?>&flashHeight=<?=height?>&flashW idth=<?=width?> (passing these to the embed and object using php btw)
View 2 Replies
Jun 4, 2010
I just did two 100% Flash sites. I always size my sites 1024 by 768 or a bit smaller. I have never had a problem with it not fitting in the browser. I exported with Flash HTML at 100%, no scale.I tested these sites on Safari and IE on different monitor sizes. They looked great.
Both of my clients are using Firefox said it cuts the bottom off by about and inch or so. I did some research and this seems Firefox does this. I read this article below and wanted to know the following:[URL]
1 - Is this the best way to fix it? Or have I developed these sites too big for FF.
2 - Is there something else I could do (i.e. export the HTML a different way?).
3 - Should I size differently in the future?I would like to prevent me having to resize the stage and change all the objects.
View 3 Replies
Jul 21, 2009
Is there a way to have the TileList component to auto-size to its contents? I have tried setting it 100%, but it seems that won't help. I don't want to hard-code the height because the content will be vary, and I don't want scrollbars to show up.
View 2 Replies
Jan 19, 2010
Here is the code I'm using for the div in question (which is the 3rd box of the javascript dynamic box):
<div class="contentdiv" style="margin:-20px 0 10px -30px;">
<object height="100%" cellSpacing="0" cellPadding="0">
<param name="movie" value="images/tri.swf">
[Code]....
I want the .swf graphic to fit the div just like the image in box #5 does.
Right now I can't get it to be either the proper size or the proper alignment. I'm admittedly not a Flash expert, so any clues would be great here.
Also, other stuff on the page is totally broken because this is just the "dev" version of the site where I test stuff out. So hopefully that can all be ignored.
View 1 Replies
Aug 31, 2010
I need to position an object in the bottom half of a container (working on flex 4)- abt 25% above the bottom...and cant use x,y coordinates given need for resizing. I have been able to position the layout containers and they work well
Also need fonts to resize as the buttons get smaller
View 1 Replies
May 11, 2011
We are building a flex project and would like it to render faster. We do have situations where we reference parent module size properties to size current module containers, as well as current module size properties for a bunch of attributes including font size and element positions and sizes.
Would it help to create temporary variables for
a) pcw=parentcontainer.width, pch= parentcontainer.height
b) ccw=currentcontainer.width, cch=currentcontainer.height
and reference to pcw,pch,ccw and cch while doing positioning. Also given the bulk of the positioning will be done in mxml, will setting these interim variables in initialization function, allow them to be used in mxml such that they will resize as browser size is changed.
View 2 Replies
Jan 20, 2012
[URL] how to build something like that with controllable column numbers, width and images that might be using XML.the main thing is how to accomplish such an effect?P.S. I've developed an Image Slider using Flash Builder 4.5 The problem is that when I included that in HTML page when someone performs ZOOM with CTRL+ Mouse wheel in a browser, the DIV that holds my SWF file and SWF file itself increases in size but the image itself that is inside my slider still remains of the same size.. How to fix it?
View 1 Replies
Feb 23, 2011
So I've created a flash movie that is 950x750 and have filled the background (bg) with an image. Then I created a HTML page and corresponding CSS so that the movie fills the browser window. Inside the flash movie I have done some calculations to make the background re-size so that it too fill the browser window. However, my calculations must be screwy, because the background is always either out of position, or resizes improperly. Grab my work files from here (didn't attach them here due to filesize restrictions): [URL]
View 6 Replies