Auto resize width height in TextFlow controller
HI,
We are facing the problem in auto resize width height in TextFlow controller. Content is overlaping withing the controller or sometimes it's seems like not full containt displaying on the control.
We are writing the below code in the flashx.textLayout.events.CompositionCompleteEvent listiner to orgnize the above step:
var controller:ContainerController = new ContainerController();
textFlow.flowComposer.composeToPosition();
var contentBounds:Rectangle = _controller.getContentBounds();
_controller.setCompositionSize(_controller.compositionWidth, contentBounds.height);
textFlow.flowComposer.addController(_controller);
textFlow.flowComposer.updateAllControllers();
Please correct if are missing any steps above.
Regards,
R.BS
Hi,
I have got the solution on my last query. Below is the code to get rid of the content display and auto adjust the width & height of the controller:
var textHeight:int = Math.ceil(_controller.getContentBounds().height);
if (textHeight > _controller.compositionHeight) {
TextDataHeight = textHeight + 12;
_controller.setCompositionSize(TextDataWidth ,TextDataHeight);
textFlow.flowComposer.updateAllControllers();
I have also set the TextDataHeight = 50 to display complete paragraph text.
Due to this I have one problem arise that is indentation of the paragraph content or bulleted text on my content.
Is any one have the solution on this?
Looking forward for your response.
Regards,
R.BS
Similar Messages
-
Auto-resizing TextArea in Flex 4
Does anyone know how I can auto-resize the height of a Spark TextArea please? I tried following the examples in http://forums.adobe.com/thread/748191 but couldn't get it to work in either Flex 4.1 or Flex Hero.
Here's what I'm doing:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<s:TextArea width="100%" heightInLines="{NaN}" minHeight="50"/>
</s:WindowedApplication>
When I press enter I need the TextArea's height to auto-resize, rather than scrolling up/down. Any help appreciated.@jeffry
it surprises me too - but try this: http://polygeek.com/2249_flex_display-html-text-in-the-spark-textarea -
Resize width of layer to canvas width
I'm having some trouble resizing a layer width to canvas width.
I know one way that works and it involves creating new document, resizing, then pasting back in. This seems extranious it seems there should be an easier way.
var width = doc.width;
var bounds = layer.bounds;
var height = bounds[3]-bounds[1]; \\get height because I want this the same
var width = doc.width;
layer.resize (width, height, AnchorPosition.MIDDLECENTER);
this seems to fail even though it seems the documentation says it should work? maybe I am misunderstanding.When dealing with layers the resize is done with percentage, so your
layer width and height are allways 100% To make it fit the document you need to work out the ratio and then resize.
This should do what you want....
main();
function main(){
if(!documents.length) return;
if (activeDocument.activeLayer.isBackgroundLayer) return;
fitLayerToDoc();
function fitLayerToDoc(){
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
var docWidth = activeDocument.width.value;
var LB = activeDocument.activeLayer.bounds;
var LWidth = LB[2].value - LB[0].value;
var percentageWidth = ((docWidth/LWidth)*100);
activeDocument.activeLayer.resize(percentageWidth,100,AnchorPosition.MIDDLECENTER);
align( 'AdRg');
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
function align(method) {
activeDocument.selection.selectAll();
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
desc.putReference( charIDToTypeID( "null" ), ref );
desc.putEnumerated( charIDToTypeID( "Usng" ), charIDToTypeID( "ADSt" ), charIDToTypeID( method ) );
try{
executeAction( charIDToTypeID( "Algn" ), desc, DialogModes.NO );
}catch(e){}
activeDocument.selection.deselect(); -
How to keep scale for height when resizing width?
Hi i have a serious of images different sizes/ ratios, which need to display at a fixed width of 50. Great works... but how do I resize the height to keep it at its original ratio?
this.attachMovie(small_image, "number1_mcs" + loop , this.getNextHighestDepth(), {_x:50 + (loop*50),_y:300,_width:50,_yscale:?????????????});}
many thanks in advance
DeeThanks for your help, being new, "terms", practices etc which others may fully understand, can fly right over ones head... It doesn't mean its impossible to understand them just grasping the exact meaning and then the specifics of any technicality can cause one to pull out more hair, especially when tired...
I fixed the problem using the following... i hope its not too ugly..!
Dee
this.attachMovie(small_image, "number1_mcs" + loop_n1 , this.getNextHighestDepth(), {_x:75 + (loop_n1*40),_y:350});
var aspect_ratio_x = this["number1_mcs"+loop_n1]._width;
var aspect_ratio_y = this["number1_mcs"+loop_n1]._height;
var aspect_ratio = (aspect_ratio_x / aspect_ratio_y);
this["number1_mcs"+loop_n1]._width = 40;
this["number1_mcs"+loop_n1]._height = this["number1_mcs"+loop_n1]._width / aspect_ratio; -
i have just finished my site which can be seen here www.jbpermanentcosmetics.co.uk The site looks fine on my Macbook pro on Mac and windows but it is way too large for 4:3 monitors. The site width is 1200 which in hindsight is too large really but i don't want to have to resize the whole website. Is there any HTML code which i can add which will auto resize the page to avoid horizontal scrolling?
rossn49 wrote:
I found the following code which looks like it might do what i want:
<SCRIPT language="JavaScript">
<!--
if ((screen.width>=1024) && (screen.height>=768))
window.location="highres.html";
else
window.location="lowres.html";
//-->
</SCRIPT>
rossn49, you can not use that javascript. It switches between two pages/sites (I bolded the code), which means you have to add another site with narrow width.... you indicated that you wouldn't like to do that.
However, you can find the sweet spot for your site design; many people started to design their sites for regular computer and also accommodate mobile devices such as iPhone.
You may like to do just that, iPhone's resolution is 960px wide, so I would conservatively take it down to 900px~920px wide.
OT, thanks for the good words... I'd not read the forum today. I'd been spending time today to figure out and mount my GPS on my new motorscooter, maybe I will buy motorscootersaurus.com for my new site. LOL! -
Width*height vals changing in save for web ??
Hi all
I've opened an EPS file in illustrator cs4. And its width & height values are differing with width & height values in "save for web" option.
For example, normally in width & height boxes shows as
width : 247.499 pt
height : 116.524 pt
but in save for web
width : 249
height : 117
I've checked with various figures too.Script lan : javascript
thanks for ur help!
Actually I've to resize the figure for the width 175, 525, 1400 and the height should change proportionally. So I tried, but I couldn't resize the figures using save for web. Becoz its horizontalScale & verticalScale treats values as percentage. eg. 175 treats as 175%. Then I grouped all items and changed its "width" and foud out the values' corresponding "height" values. But the problem is, exported file's values are changing nearly 3pts.
could u help on this? -
JTable in JScrollPane auto resize refresh problem
Hello,
I have a JTable in a JScrollPane. Number of rows is changing.
I'm using the following to auto-resize JScrollPane.
public Dimension getPreferredSize() {
Dimension size = super.getPreferredSize();
size.height -= getViewport().getPreferredSize().height;
Component view = getViewport().getView();
if(view != null)
size.height += view.getPreferredSize().height;
return size;
}There is a JButton, which adds an empty row to the JTable. It all works fine, except the auto-resize when a new row is added. I want all rows of JTable to be visible, with no scrollbars present. I tried repaint(), revalidate(), addNotify(). What should I do?
Thanks.Sure
DefaultTableModel dtm = new DefaultTableModel(vec, header);
jt0 = new JTable(dtm);
jt0.getTableHeader().setReorderingAllowed(false);
jt0.setFont(new Font("Tahoma", Font.PLAIN, 12));
jt0.getTableHeader().setFont(new java.awt.Font("Tahoma", java.awt.Font.BOLD, 12));
jt0.setRowHeight(18);
jt0.setPreferredScrollableViewportSize(new Dimension(500, jt0.getRowCount() * jt0.getRowHeight()));
jt0.setFillsViewportHeight(false);
jsp0 = new JScrollPane(jt0);
GridBagConstraints gbc = new GridBagConstraints();
gbc.insets = new Insets(2,1,2,1);
gbc.weightx = 1.0;
gbc.weighty = 1.0;
JPanel p0 = new JPanel(new GridBagLayout());
gbc.fill = gbc.HORIZONTAL;
p0.add(jsp0, gbc);
JButton jb1 = new JButton("add row");
jb1.setSize(40, 18);
jb1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
dtm.addRow(new Object[]{....});
// jt0.scrollRectToVisible(jt0.getCellRect(jt0.getModel().getRowCount()-1, 1, false));
// jt0.setRowSelectionInterval(jt0.getModel().getRowCount()-1, jt0.getModel().getRowCount()-1);
public class SizeX extends JScrollPane {
public Dimension getPreferredSize() {
Dimension size = super.getPreferredSize();
size.height -= getViewport().getPreferredSize().height;
Component view = getViewport().getView();
if(view != null)
size.height += view.getPreferredSize().height;
return size;
} -
Width/height/x/y value mismatch with the reality and what is coded
hello there everyone,
hope i got the title right..,
so here goes the problem i need your opinion and help to solve:
application definition:
i have this desktop flash application that will go fullscreen what this application do is loading external asset (mostlySWF) and play it inside this application. Each external asset will be place inside a container/holder (empty movie clip created by code), each of this container have it's own dimension ( width, height, x, y).my code all working without any warning nor error.oh and i also have an image.jpg/png as it's background and place at the bottom of display list (depth = 0), the image is customly made with using photoshop and each container location and dimension also measured there so it just needed to be writen down is the XML file..,
the problem:
the bug is when i loaded some image of those background image each container width,height,x,y will mismatch with what i have in the XML file.
the funny thing is when i trace the value of each container width,height,x,y it value is the same with what the XML has yet by seeing with eye you know that is wrong..,
here's the code i used:
var myXML:XML; //to hold the loaded xml file
var SWFList:XMLList; //used to hold a list of all external swf source,atribute and etc
var xmlLoader:URLLoader = new URLLoader(); //intance of URLloader class used to XML file
var totalSWF:int; //hold the total number of external swf there is to be loaded
var mainContainer:MovieClip =new MovieClip();//act as the main container
var SWFContainer:MovieClip; //hold the loaded SWF as it's child
var swfLoader:Loader; //instance of loader class used to load the external swf
var myCounter:int = 0; //used to track how many external swf has been loaded and added to stage
var bgImageURL:String;//hold the url of the background image
var imageLoader:Loader;//intance of loader class used to load background image
// Stage Setting
//========================================================================================
this.stage.align = StageAlign.TOP_LEFT;
this.stage.scaleMode = StageScaleMode.NO_SCALE ;
this.stage.displayState = StageDisplayState.FULL_SCREEN;
//load the xml file
//======================================================================================== ==
xmlLoader.load(new URLRequest("FlashBlock[s].xml"));
xmlLoader.addEventListener(Event.COMPLETE, processXML);
function processXML(e:Event):void
e.target.removeEventListener(Event.COMPLETE , processXML);
myXML = new XML(e.target.data);
bgImageURL = myXML.Background.text();
SWFList = myXML.BLOCK;
totalSWF = myXML.BLOCK.length();
doSizeUpMainContainer();
loadBackgroundImage();
function doSizeUpMainContainer():void
//resizing the mainContainer dimension
//in this case i just make the size the same as the screen dimension
addChild(mainContainer);
mainContainer.graphics.beginFill(0xFD562D, 0);
mainContainer.graphics.drawRect(0,0, stage.stageWidth, stage.stageHeight);
mainContainer.graphics.endFill();
function loadBackgroundImage():void
//load the background image
imageLoader = new Loader();
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onBgImageLoadComplete);
imageLoader.load(new URLRequest(bgImageURL));
function onBgImageLoadComplete(e:Event):void
e.target.removeEventListener(Event.COMPLETE, onBgImageLoadComplete);
mainContainer.addChild(imageLoader.content);
imageLoader.x = (stage.stageWidth - imageLoader.content.width)/2;
imageLoader.y = (stage.stageHeight - imageLoader.content.height)/2;
loadSWF();
function loadSWF():void
swfLoader = new Loader();
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE , swfSetting);
swfLoader.load(new URLRequest(SWFList[myCounter].@source));
function swfSetting(e:Event):void
e.target.removeEventListener(Event.COMPLETE , swfSetting);
SWFContainer = new MovieClip();
mainContainer.addChild(SWFContainer);
// i did this so i can resize the movieclip size to what i need..,
SWFContainer.graphics.beginFill(0xff6633, 0);
SWFContainer.graphics.drawRect(0,0, Number(SWFList[myCounter].@width), Number(SWFList[myCounter].@height));
SWFContainer.graphics.endFill();
SWFContainer.x = SWFList[myCounter].@left;
SWFContainer.y = SWFList[myCounter].@top;
SWFContainer.addChild(e.target.content);
//load and add another SWFContainer untill all swf listed in the swf added
if(myCounter < (totalSWF-1))
myCounter++;
swfLoader = null;
loadSWF();
i really do not have any idea why this could happen and how to solve it..,
any help would be greatly apprecited cause i'm literally meeting a dead end with this bug..,hello there kglad,
thanks for responding in this thread..,
i did what you told me :
i did check all of my loader instance till myLoader.parent.parent.parent and it return 1 for every single one of them
but by removiing the "this.stage.displayState = StageDisplayState.FULL_SCREEN;"
i do get new error which is:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at slideshow_fla::MainTimeline/doAspectRatio()
well from what it tokd me it came from my slideshow swf..,(this swf also fully code and has nothing placed on stage by manually)
the thing is in my mine swf code i never refer to what external asset property, i just told to load it and when the load is complete i put it in the display list..,
from googling i suspect that it played to early beacause i put the script in the first frame of the timeline of slideshow.swf
and for the moment i'm trying to find what error do cause it..,
(but why this didn't happen all the time??)
here is the slideshow code:
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.display.*
import flash.utils.Timer;
import flash.events.TimerEvent;
//list of global variables
var mySlideSpeed:Number; //determine how long each image displayed
var myTransitionName:String; //the name of the transition to be used
var myxmlList : XMLList;//reference to the list of the image
var myTotal:int; //total of image to be displayed
var myImage:Loader;//load the image into the container
var tempWidth:int;
var tempHeight:int;
var myTraansitionInDuration:int = 2;//the duration of transition in effect
var myTraansitionOutDuration:int = 2;//the duration of transition out effect
var myThumbHolderArray : Array = [];//to hold each thumbimage of the image
var Counter : Number = 0; //to count how many image has been successfully loaded
var myMC : MovieClip = new MovieClip(); //as the container of the picture so that it can be manipulated with transition manager
var container: MovieClip = new MovieClip();//hold the image after transition
var myImageTracker :Number = 0; //to know which image is in the stage
var myTimer :Timer; //the timer
var myTM:TransitionManager = new TransitionManager(myMC);//instance of transitionmanager class;used to give transition effect the image
//creating the loader instance n loading the file
var myXML:XML;
var XMLLoader :URLLoader = new URLLoader();
XMLLoader.addEventListener(Event.COMPLETE, processXML);
var base:String = this.root.loaderInfo.url;
base = base.substr(0, base.lastIndexOf("/") + 1);
XMLLoader.load(new URLRequest(base + "slideshow.xml"));
function processXML(e:Event):void
e.target.removeEventListener(Event.COMPLETE, processXML);
XML.ignoreWhitespace = true;
myXML =new XML(e.target.data) ;
mySlideSpeed = Number(myXML.transition.@slidespeed) + myTraansitionInDuration + myTraansitionOutDuration ;
myTimer = new Timer (mySlideSpeed*1000);
myTimer.addEventListener(TimerEvent.TIMER, imageRemover);
myTransitionName = myXML.transition.@name;
myxmlList = myXML.IMAGE;
myTotal = myXML.IMAGE.length();
imageLoader();
function imageLoader():void
for (var i:Number = 0; i < myTotal; i++)
var imageURL:String = base + myxmlList[i];
var myLoader:Loader = new Loader();
myLoader.load(new URLRequest(imageURL));
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete)
//transfering each thumb image loaded to a variable to be able to be refered back when the show is running
myThumbHolderArray.push(myLoader);
function onComplete(e:Event):void
Counter ++;
if(Counter == myTotal)
e.target.removeEventListener(Event.COMPLETE, onComplete);
showStarter();
function showStarter():void
addChild(container);
addChild(myMC);
// myMC.x = container.x = myMC.y = container.x = 0;
doAspectRatio();
imageSlider();
function doAspectRatio():void
for (var i:Number = 0; i < myTotal; i++)
myImage = Loader (myThumbHolderArray[i]);
if (myImage.width > myImage.height)
tempWidth = myImage.width;
tempHeight = myImage.height;
//supposedly to access the container dimension holding this swf as it's child
myImage.width = this.parent.width;
myImage.height = (tempHeight * this.parent.height)/tempWidth ;
else if (myImage.width < myImage.height)
tempWidth = myImage.width;
tempHeight = myImage.height;
myImage.height = this.parent.height;
myImage.width = (tempWidth * this.parent.width)/tempHeight ;
function imageSlider():void
if (getChildIndex(container)== 1)
swapChildren(myMC, container);
myImage = Loader (myThumbHolderArray[myImageTracker]);
myMC.addChild(myImage);
//center the image
myImage.x = (this.parent.width - myImage.width)/2;
myImage.y = (this.parent.height - myImage.height)/2;
if (myTransitionName == 'Fly')
myTM.startTransition({type:Fly, direction:Transition.IN, duration:myTraansitionInDuration, easing:None.easeIn, startPoint:7});
else
if (myTransitionName == 'Zoom')
myTM.startTransition({type:Zoom, direction:Transition.IN, duration:myTraansitionInDuration, easing:Strong.easeIn});
else
if (myTransitionName == 'Photo')
myTM.startTransition({type:Photo, direction:Transition.IN, duration:myTraansitionInDuration, easing:None.easeIn});
else
if (myTransitionName == 'Squeeze')
myTM.startTransition({type:Squeeze, direction:Transition.IN, duration:myTraansitionInDuration, easing:Strong.easeIn, dimension:0});
else
myTM.startTransition({type:Fade, direction:Transition.IN, duration:myTraansitionInDuration, easing:Strong.easeIn});
myTM.addEventListener("allTransitionsInDone", holdDelay);
function holdDelay(e:Event):void
this.removeEventListener("allTransitionsInDone", holdDelay);
myTimer.start();
container.addChild(myImage);
if (getChildIndex(myMC)== 1)
swapChildren(container, myMC);
function imageRemover(e:Event):void
myImageTracker ++;
if (myImageTracker == myTotal)
myImageTracker =0;
imageSlider();
and by the way can you tell me the reason you told me to remove "this.stage.displayState = StageDisplayState.FULL_SCREEN;" line ?? -
JTable column auto-maximum width
Hi,
Does anyone have an idea on how to make the JTable to support column auto-maximum width resize, like we always see in a microsoft's table component, you double click on the column seperater and the column resized to its maximum size according to the content in it.
Thanks
YutongHi again,
I wrote two methods to solve this kind of problem... take a look at them and tell me what you think about it...
/** Adjusts the widths of a JTable columns
* @param table the table
public static void resizeTableColumns(JTable table) {
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
TableColumn c = null;
FontMetrics fm = table.getFontMetrics(table.getFont());
for (int i=0; i<table.getColumnCount(); i++) {
c = table.getColumn(table.getColumnName(i));
c.setPreferredWidth(determineColumnWidth(c, table.getModel(), fm));
/** Returns the preferred width of a JTable column. The resulting width
* is 5 pixels wider than the biggest column
* @param col the column
* @param model the table model
* @param fm the font metrics
public static int determineColumnWidth(TableColumn col, TableModel model,
FontMetrics fm) {
String value = (String)col.getHeaderValue();
int headerWidth = fm.stringWidth("." + value.trim() + ".");
int columnNumber = col.getModelIndex();
int max = headerWidth;
int columnWidth = 0;
int nrows = model.getRowCount();
String cell = "";
for (int i=0; i<nrows; i++) {
value = (String)model.getValueAt(i, columnNumber);
columnWidth = fm.stringWidth("." + value.trim() + ".");
if (columnWidth > max) max = columnWidth;
return max + 5; -
Pshop CS3 Save for Web Increases Width/Height
Hi, I've been using Photoshop for 15 years and used the Save for Web at CS2 without problem. In CS3, it is downsampling the res from 300 ppi to 72 correctly but at the same time increasing the width and height, as though I'd gone into Image Size to do the resize and had the Resample Image field unchecked. This worked fine in CS2, so what gives? I can't find any setting that needs to be changed in the Save for Web interface.
Buko, I respectfully submit that your comment makes no sense. In CS2, using Save for Web automatically cut down the ppi to 72, and it removed web-unnecessary things like previews and paths so that the file could become smaller. It did NOT change the width or height of the image.
The CS3 version is cuts down the res to 72ppi. This is fine. The problem we're experiencing (on more than one machine) is that it's growing the width and height as though it's not downsampling when it changes the res. IF that's what you mean by "strictly pixel based," then OK, but it's problematic.
This is exactly the opposite result that you get if you take a digital camera photo that has a large dimension but low res, and increase the res to 300 while not allowing it to resample: you get a high-res image with smaller width/height image, as all pixels get smaller but maintain their exact colors.
If the CS3 version of Save for Web changes the diensions of the image, which is frequently created based on the final dimensions needed in the web page, then it's freakin' useless, and I might as well create an Action using Image/Image Size to reduce the res but maintain dimensions. -
What I'm doing is making a calendar and when you click on a
day a small pop-up window of that day's activities pops up. Well
not all the days have the same amount of activities, so is it
possible to have pop-up windows that auto-resize according to how
much text is in the pop-up window?i dont know of any extensions that provide this....
however you could do something based on # characters. create
some calculation for the height of the window based on #
characters. -
Need to find "real" width/height of loaded SWF
So, I'm creating a player that will eventually be able to
play back both FLV and SWF files. While testing the SWF
functionality, I noticed some funkiness with resizing the SWF once
loaded into a movieClip.
Yes, I already do know that loading (via MovieClipLoader)
needs to have finished before I can get the actual width and height
of the SWF in question... that's not the issue.
The issue is that I will not know ahead of time what the SWF
dimensions are. Which should be ok, as long as I can get accurate
dimensions after the SWF has loaded. However, I do not have control
over the source SWFs - they could come from anywhere (many content
providers), and in the event that the remote SWF uses masking, the
width and height may not quite be accurate.
Here is an example - as a test, I have my player load
http://www.magicarchive.com/jawsbunnies.swf
into a movieclip via MovieClipLoader. Peachy-keen, it works. I then
want to resize the movieclip to be 400px wide by 300 tall. Doing
this by setting _width and _height (or _xscale and _yscale) makes
the visible area of the movie too small because of masking or
whatever (before scaling, tracing _width and _height on the source
movie shows width = 856.4 and height = 637.45... after resizing the
swf in a movieclip to 400wide x 300 tall, the actual visible movie
seems to be more like 334wide x 254tall). I can't even center the
smaller-than-I-want-it-to-be clip because I can't determine its
real width.
So, how might I find the "real" width/height of the visible
area? Is it a case of requiring some accompanying metadata from my
SWF providers? I've also tried using hitTest, and while the hitTest
area is slightly smaller than the width and height, it is still
slightly larger than the real visible dimensions, so testing the
hittable area to determine the visible area won't work, either. I'd
like to try determining SWF dimensions without having to bother
providers, though.
When I put this same SWF into an HTML page with Dreamweaver,
it automatically sizes to 720x540, which seems to be the "real"
visible dimensions. How do I get to those dimensions once the SWF
is loaded into a movieClip, though?
Thanks for any help.Doh. I read in another post that "there is no way to
determine what size at which an SWF was exported".
So, there is no way I can determine the real visible
dimensions of an SWF I have no control over?
It seems like there SHOULD be a way to do this - since for
example, if I embed an SWF into an HTML page (via Dreamweaver),
Dreamweaver automatically determines the correct "Stage" size. This
is what I need to do, only within AS... -
Animating width/height by percentage
Hello,
I would like to animate the percentage width / height of
various on-screen objects when I mouse over various parts of the
app. AnimateProperty might seem like a candidate, but it doesn't
appear to support percentages.
Is there a recommended way to implement this?
-AllanInstead of setting a width and height in the applet tag, have you tried this?
Here's instantiating the applet --
<applet id='myApplet' ...></applet>
And here's my javascript --
function resizeApplet() {
var appObj = getElementById(win, 'myApplet');
if (appObj != null) {
if (self.innerWidth != null && self.innerHeight != null) { // Fix for Mozilla/Netscape browsers
width = self.innerWidth;
height = self.innerHeight;
} else if (document.body.clientWidth != null && document.body.clientHeight != null) { // IE5+
width = document.body.clientWidth;
height = document.body.clientHeight;
} else {
width=600;
height=200
appObj .width = width - 50;
appObj .height = height;
// Helper function used above to clean up resize code.
function getElementById(win, id) {
if (win.document.getElementById)
return win.document.getElementById(id);
if (win.document.all)
return win.document.all[id];
if (win.document.layers)
return win.document.layers[id];
return null;
Safari still doesn't dynamically resize the applet? I am using Safari 1.1.1 -- should I update to 1.2? -
Cannot force max width height for app
Hi
No matter what I set in my app's xml file it will always resize to the device width/height. At this stage we are only supporting iPhone 4 resolution (480x320), so if the app is installed on iPad it should be presented at 480x320 (we are landscape only). I'm not how and where to set this? The initial splash screen displays correctly but once the app has loaded it then reverts to fullscreen. Setting fullscreen to false enables the info bar at the top but the app is still presented at the native iPad resolution.
Thanks for any input.
BenIn the app descriptor you can set which devices are to be used. If you set it to know devices 1 and 2, then it will fill the screen on the iPad. If you only set it to know device 1, it will show as a little area in the middle of the iPad screen, with the 2X button for the user to use if they wish.
Look for this line:
</InfoAdditions -
I have created a chart with the jfreechart package and placed it on a ChartPanel which I then added to a JPanel. The JPanel is auto-resizable in the horizontal direction so when the user resizes the window, the panel stretches horizontally to fill the width of the window. However the ChartPanel doesn't resize automatically. I would like this to happen also. Is there some way to do this?
I have included the method that I use to create the chart, chartpanel and place everything on the JPanel.
private void updateGraph()
dataset = new DefaultCategoryDataset();
for (int i=0;i<pickerIDs.length;i++)
dataset.setValue(linesPerPicker, "x/y", pickerIDs[i]);
barChart = ChartFactory.createBarChart("Picker Statistics", // Title
"Picker ID", // Horiz units
"Total Lines", // Vert units
dataset,
PlotOrientation.VERTICAL,
false, // legend
true, // tooltips
false); // urls
// Place on a chart panel
chartPnl = new ChartPanel(barChart);
chartPnl.setSize( jPanel1.getWidth(), jPanel1.getHeight());
jPanel1.removeAll();
jPanel1.add(chartPnl);
jPanel1.validate();
jPanel1.repaint();Hi, thanks for responding.
I did the following, hoping that this is what you meant by using a BorderLayout but the results are the same (BTW - Although I am familiar with Java, I am new to Java GUI):
private void updateGraph()
dataset = new DefaultCategoryDataset();
for (int i=0;i<pickerIDs.length;i++){
dataset.setValue(linesPerPicker, "x/y", pickerIDs[i]);
barChart = ChartFactory.createBarChart("Picker Statistics", // Title
"Picker ID", // Horiz units
"Total Lines", // Vert units
dataset,
PlotOrientation.VERTICAL,
false, // legend
true, // tooltips
false); // urls
// Place on a chart panel
chartPnl = new ChartPanel(barChart);
chartPnl.setSize( jPanel1.getWidth(), jPanel1.getHeight());
chartPnl.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
jPanel1.removeAll();
jPanel1.add(chartPnl, BorderLayout.EAST);
jPanel1.validate();
jPanel1.repaint();
Maybe you are looking for
-
Excel spreadsheet on MSN(one drive) and Outlook 365 online, "embass code"
Dear Experts, First apology for my English and second, might be wrong place.... I have one spreadsheet, I uploaded it to msn account on "one drive" , and i shared this spreadsheet with "embed code" option and i got this code to work it onto my per
-
Problem in opening ".pps" file from jsp
My ".pps" file is on server i want to open this file on client side in microsoft office or inside IE. But right now all other types of file are opening except ".pps". small part of that code is <% for(int i=0;i<count1;i++) { %> <tr align="center"> <t
-
How to write Join View Adaptor which will pull data from Siebel and OID ?
Hi Experts, I wanted to write web service call where OIF will talk to OVD than OVD will have join adaptor which will pull few data like msisdn from Siebel and view data from oid like given name and generate SAML assertion. I wanted to know how to wri
-
Hello All We have created NEW output type for the RFQ & PO , We want to print the RFQ & sending mail to vendor also Whether in the out type in default value transmission medium for one Printout & another send external need to be maintained? Also aft
-
Hi all I want see SAP note 881469, how to find out i tried in SAP library and could not find it Regards Cool Ice