Fl.controls.RadioButton Width 100 Issue?
I'm trying to use the RadioButton in a narrow component and position it programmatically,however the size of the Sprite that contains the is always at least 100 wideI'm using the fl.controls.RadioButton classhere is an example: var _sprite:Sprite = new Sprite(); trace("_sprite width:"+_sprite.width); //traces out to 0 var _rb:RadioButton = new RadioButton(); _rb.label = "test"; _rb.textField.autoSize = TextFieldAutoSize.LEFT; _rb.setSize(40,20); // _rb.removeChildAt(0); trace("_rb width:"+_rb.width); //teases me with 40 _sprite.addChild(_rb); trace("_sprite width:"+_sprite.width); //traces out to 100???i took a peek at the class itself and notice in the RadioButton.as: var bg:Shape = new Shape(); var g:Graphics = bg.graphics; g.beginFill(0,0); g.drawRect(0,0,100,100); g.endFill(); background = bg as DisplayObject addChildAt(background,0);What's this bit doing?If you remove the comments from before //_rb.removeChildAt(0); //this effectively removes the RadioButton background "shape"in the my above example the width traces out to 20 (i would have bet 40 but better than 100) ; I was unable to get setSize to do anything useful. it would trace the _rb.width correctly, but once _rb was applied to _sprite the _sprite would then trace out to 100...I only noticed this problem trying to get a smaller number than 100...Any insight what is going on would be helpfullthanks again--m@I'm using Flex Builder 2 for what it's worth.
KirupaForum > Flash > ActionScript 3.0
Posted on: 10-19-2007, 05:38 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
RadioButton Label Issue
I have given my radio button a label "Navigation with Frame Label" but the problem is that when I publish the swf the lower part of the text is cut which makes the text unreadable. I have tried out different things like changing the height of the radio button and using the
my_rb.setStylePropert("textSize",14) but nothing has worked so far so could you plz tell me how to go about it. One other thing is that I am using this swf as a custom UI in another fla component which make the appearance of the text even worse so kindly tell me some way around to over come this problem.
YouTube-like Player Controls - "Stretch" To Parent Movie Width And Stay Unscaled
Hello,
I am trying to program a set of movie player controls in a separate, external SWF that I can dynamically load into other movies, but keep the player controls' height and resolution untouched, so that the PLAY button will always be the same original size, no matter what size the parent movie dimensions are - similar to how YouTube currently displays their player controls: No matter how big you view their movies, small, normal size or full screen, the player controls at the bottom always stay the same height, but will "stretch" to the containing movie's overall width.
You can see what I have so far here:
http://www.redguitar.com/gflix/dynamic_controls.html
You will see two of the same flash movies at different size dimenions. You will also notice the green bar at the bottom of the movies. These are my player controls that I need help with.
I have no problem getting the controls to stretch to the parent movie's width, I just don't know how to load these controls 'Unscaled' so that you can still see the controls clearly and at the size they are meant to be seen at.
Anyone have any ideas?
I tried to search but had no luck trying to find a solution. I know this should be easy to figure out, but its taking me a long time unfortunately.
Thanks in advance!
Width Issue
I am using Flash MX Professional. When I run my flash swf pages in a browser (explorer, opera, safari, netscape) there is extra space at the top and bottom. In my publish settings I have set it to 100%. I have also tried adding html top and bottom margin properties to zero, but that didn't work either. Does anyone have an idea how to resolve this problem?
Thank you.
Width Issue
Hello guys.
I have an issue about flash. I creating an animation. Everything ok but one thing. I trying test my movie in flash its not showing completely. Also i saving and trying outside flash but this time i can see outside of the stage. Can you show me a cause for this? I asked it to one of my friends and he said "this width(900px) not compatible web standarts. So flash show outside the stage." but i think this is false. Here a screenshot from my animation. Thanks from now. Also thanks for interest:)
http://img99.imageshack.us/img99/9046/adszur6.jpg
Edited: 04/19/2007 at 04:51:51 AM by pHeR-d
Simple Width Issue
Ok, try this code.. it simply creates few movie clips, and fills them, nothing special.
When the code runs to increase the width of one, why does the x position move too? Also, whats the difference between a movieclips 'x' position and it's '_x' position???
ActionScript Code:
entX=40
entY=40
for(a=1;a<6;a++) {
ttt=_root.createEmptyMovieClip("entry_"+a,_root.getNextHighestDepth())
ttt.x=entX
ttt.y=entY
ttt.width=60
ttt.height=16
ttt._alpha=50
entX+=32
with (ttt) {
moveTo(entX,entY)
beginFill(0x909090,100)
lineTo(entX+60,entY)
lineTo(entX+60,entY+16)
lineTo(entX,entY+16)
endFill()
}
}
setInterval(doit,15)
function doit() {
q=_root["entry_1"]
q.width++
}
DataGrid Component - Width Issue
Hey all,
having a bit of trouble to get my data grid working so that it is set the stage.width - 250;
therefore it would scale with the window when minimised...any ideas??
Thanks Heaps in advance!!
CreateTextField Incorrect Width Issue
Hi,
I´m having trouble defining a text field width. I´m loading an XML file into Flash, and I want some text of it to become buttons in flash, but they need to be placed horizontally. This is were the trouble appears, every word is placed on top of the other. I have no trouble if I try to arrange them vertically, but horizontally makes a total mess.
This is what I´m trying to do:
Code:
publiNames = [Very long long name, Tiny, Short, Another one]
for(i=0; i<4; i++) {
titulo = titleContainer.createEmptyMovieClip("botonTitulo", titleContainer.getNextHighestDepth());
subtitulo = titulo.createTextField(publiNames[i],i,subtitulo.textWidth*i,0,subtitulo.textWidth,15);
subtitulo.text = publiNames[i];
subtitulo.selectable = false;
subtitulo.antiAliasType = "advanced";
subtitulo.embedFonts = true;
tFormato = new TextFormat();
tFormato.font = "FuturaMdBT";
tFormato.leftMargin = 15;
subtitulo.setTextFormat(tFormato);
}
So basically what I´m trying to do is put the names of publiNames horizontally on the screen and then make them buttons. They come from an XML file so their size won´t always be known and they need to look good every time. But what happens is that the very long name doesn´t appear completely and the other three appear one on top of the other. I don´t know why the "textWidth" property only works once and why the whole text won´t appear. If I set the "autoSize" property to false the whole text appears in the text field but everything appears on top of everything.
Does anybody know how to fix this?
Thanks.
[AS/XML] Width, Height Issue When Loading Swf Into Flash
I´m having a problem with loading in different swf files into the stage. If I use a empty movieclip (holder) nothing shows up but when I set the width and height of the holder_mc the swf files show up but are zoomed in for some reason. Please help..
Here is my code.
Code:
var x:XML = new XML();
x.ignoreWhite = true;
var urls:Array = new Array();
var captions:Array = new Array();
var whoIsOn:Number;
x.onLoad = function() {
var swf:Array = this.firstChild.childNodes;
for(i=0;i<swf.length;i++) {
urls.push(swf[i].attributes.url);
captions.push(swf[i].attributes.caption);
}
holder.loadMovie(urls[0]);
caption.text = captions[0];
whoIsOn = 0;
}
x.load("show.xml");
previous.onRelease = function() {
if(whoIsOn > 0) {
whoIsOn--;
holder.loadMovie(urls[whoIsOn]);
caption.text = captions[whoIsOn];
}
}
next.onRelease = function() {
if(whoIsOn < urls.length-1) {
whoIsOn++;
holder.loadMovie(urls[whoIsOn]);
caption.text = captions[whoIsOn];
}
}
Parent - Child Relation: Width Issue
I probably am missing something, but when I change the width of a parent movieclip, the width of the child movieclip also changes.
Like I start with this:
and do
Code:
parent.width *= 2;
then the width of the child will also double, which I don't want to happen. Is there some kind of property I need to set so that the width of the child does not change when the width of the parent changes?
Thanks!
Exposing Width And Height Of Custom Class Issue
Hi,
I created a custom class that uses the loader to load an image into a child clip in the class. I want to expose the width of this clip as a property so I can grab it elsewhere (document class). My issue I think is I'm grabbing the property value before it is fully loaded or instantiated so I get width of 0 instead of the actual width of the image. How do I fix this so I can grab the width? Please help!
My custom class:
...
ActionScript Code:
private var _intImageWidth:Number = 0;
public function get ImageWidth():Number {
return _intImageWidth;
}
public function imgFadeIn(strImageURL:String) {
oLoader = new Loader();
var oRequest:URLRequest = new URLRequest(strImageURL);
oLoader.load(oRequest);
oLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded);
}
private function imgLoaded(event:Event):void{
var mcImage:MovieClip = new MovieClip();
mcImage.name = "mcImage";
mcImage.addChild(oLoader.content);
this.addChild(mcImage);
_intImageWidth = oLoader.content.width;
}
My document class:
...
ActionScript Code:
private function initializeScene():void {
//load in main image
var oMCImage:customClass = new customClass("image.jpg");
oMCImage.name = "mcImage";
this.addChild(oMCImage);
//this is accessing the clip before it gets loaded into interface so default oMCImageWidth is zero??
oMCImage.x = stage.stageWidth/2 - (oMCImage.ImageWidth/2);
}
2 Player Game. Moving Cars Controls Help With Controls
hi i have the controls for car number 1 that would be the arrow keys if
(Key.isDown(Key.RIGHT)) {
this._rotation += manuverSpeed;
} else if (Key.isDown(Key.LEFT)) {
this._rotation -= manuverSpeed;
}
if (Key.isDown(Key.UP)) {
if (speed<speedMax) {
speed += accel;
}
} else if (Key.isDown(Key.DOWN)) {
if (speed>-speedMax) {
speed -= accel;
but how can i make controls for car 2 ... i wann use wasd but i cant figure out how the key.a doesnt work.
Drag Controls Override All Other Controls On Movie?
I have a movie that loads into the main timeline and can be dragged around using:
on (press) {
startDrag("");
}
on (release) {
stopDrag();
}
That works great except that to close that movie again I've added a little button to say on press, unload movie.
Problem is none of the buttons or links on that page will work while it is being dragged around. How can I make the links and buttons work but still make the movie draggable?
Listbox Width = Longest Text Width How? Please Urgent.
hi there
i want to make the listbox as wide as the longest textentry, but i only have
_lb.setWidth()
and
_lb.setSize()
and those two are for pixel size???
does someone of you know how to do that
thx a lot
cheers marcel
Set Width Of A ComboBox Component Without Changing Width Of Arrow
Hi,
With actionscript I have put a few ComboBoxes on the stage and than tryed to change the width with:
setProperty(_root.container[ComboBoxName],_width,150);
It works, However the arrow-part in the combobox expands also. I don't want it to expand.
I want it to behave like when a put a combobox on the stage myself and adjust the width of it in the properties window.
In this case only the text-part expands... the size of the arrow doesn't change!
How can I do this?
Internal Clip Width Bigger Than Movie Width?
i have a movie that is 750 pixels wide. i have a movieclip inside this main movie called "menuBack" that is just a bit less wide than the main movie. this movieclip has several other clips inside of it. i set a variable on a keyframe in my main movie getting the width property of "menuback". of course i expected it to be just a bit less wide than my main movie, maybe 720 pixels wide. when i test the movie and then check debug/list variables, it say it is 1095 pixels wide...how is this possible?
flash 5 btw...
1000px Width Flash In 500px Width Div Problem
Hi
I've got one problem here...
I have 00px width flash, which goes in to 500px width div.
everything is ok. just flash is left aligned... i can't make it to laign to center.
div style overflow is hidden. so no scrollbars. just flash has to go center aligned... not left aligned, as it is now...
align="center" does not help...
thanks in advance
Dynamic Background Width/static Foreground Width?
I am trying to make a site with elements that resize dynamically depending on the browser width, but have the foreground element stay the same size all the time?
The first part is easy to do. If I set the height and width of the Flash file in the HTML to 100%, when the browser is resized, the Flash will also resize.
But I can't figure out the second part.
An example of what I'm trying to do is at Rilo Kiley's website
Another example is gskinner.com
No matter what your browser size, the background scales and the foreground is always the same width and height.
I am using Flash MX 2004.
Loaded Image.width Be Stage.width On Resize
Hello... I am trying to make a loaded image.width be the stage.width on resize... the same for the height... I'm tweening them also... and that seems to be working... well on the yx... not so much on the width.... If I use Stage.width directly in the tween it seems to not load the image... little lost here... thank you for any help...
jeremyBass
here is what I have which is the whole file
ActionScript Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
// ***Stage aligned top left
Stage.align = "TL";
// *** Stop the stage from scaling with the browser window.
Stage.scaleMode = "noScale";
Stage.showMenu = false;
stop ();
image_mc1.loadMovie("http://hellscanyonsportfishing.com/images/testhead.png");
image_mc2.loadMovie("http://hellscanyonsportfishing.com/Scripts/flash/bk.jpg");
image_mc1._quality = "BEST";
image_mc2._quality = "BEST";
// initiate postitions and scaling values for objects
v = Math.random() * 6 - 3;
v = Math.random() * 6 - 3;
var curStageheight = Stage.height;
var curStagewidth = Stage.width;
imageHolder._height = curStageheight;
imageHolder._width = curStagewidth;
//var xScaleT:Tween = new Tween(image_mc1, "_rotation", Elastic.easeOut, 0, 10, 4, true);
var xScaleT0:Tween = new Tween(image_mc1, "_x", Bounce.easeOut, 0, -2*v, 3, true);
var xScaleT1:Tween = new Tween(image_mc1, "_y", Bounce.easeOut, 0, -6*v, 4, true);
var xScaleT4:Tween = new Tween(image_mc2, "_width", Bounce.easeOut, imageHolder._width*1.1, imageHolder._width*1.15, 3, true);
var xScaleT5:Tween = new Tween(image_mc2, "_height", Bounce.easeOut, imageHolder._height*1.1, imageHolder._height*1.15, 3, true);
var xScaleT2:Tween = new Tween(image_mc2, "_x", Bounce.easeOut, 0, 0-2*v, 2, true);
var xScaleT3:Tween = new Tween(image_mc2, "_y", Bounce.easeOut, 0, 0-8*v, 2, true);
xScaleT0.onMotionFinished = function() {
this.yoyo();
};
xScaleT1.onMotionFinished = function() {
this.yoyo();
};
xScaleT2.onMotionFinished = function() {
this.yoyo();
};
xScaleT3.onMotionFinished = function() {
this.yoyo();
};
xScaleT4.onMotionFinished = function() {
this.yoyo();
};
xScaleT5.onMotionFinished = function() {
this.yoyo();
};
image_mc1._y = 0;
image_mc1._x = 0;
image_mc2._y = 0;
image_mc2._x = 0;
//create a listner that checks to see if the browser window is resized
sizeListener = new Object();
sizeListener.onResize = function() {
// change movieclip properties when the window is resized.
var curStageheight = Stage.height;
var curStagewidth = Stage.width;
imageHolder._height = curStageheight;
imageHolder._width = curStagewidth;
//create a random velocity for x and y direction
};
Stage.addListener(sizeListener);
Adjusting Text Tool's Width To Screen's Width
Hi all,
I'd like to know howshould I do to adjust text tool's width to screen's width automatically?
Because I want to insert my flash into a Visual Basic screen saver.
Regards,
Phil
Urgent Help Horizontal Xml Menu Width Needs To Be Text Width
Please could someone help me with the following. I have been through this tutorial http://www.kirupa.com/developer/act...opdown_menu.htm of the xml drop down menu. Made some adjustments with help from other posts to make it horizontal.
but the width of the buttons (menu items) need to be created/adjusted according to the text. and not according the movie it created.
Could someone help me solve this problem? I just can't get it done.
the as:
// generates a list of menu items (effectively one menu)
// given the inputted parameters. This makes the main menu
// as well as any of the submenus
GenerateMenu = function(container, name, x, y, depth, node_xml, direction) {
// variable declarations
var curr_node;
var curr_item;
var curr_menu = container.createEmptyMovieClip(name, depth);
// for all items or XML nodes (items and menus)
// within this node_xml passed for this menu
for (var i=0; i<node_xml.childNodes.length; i++) {
// movieclip for each menu item
curr_item = curr_menu.attachMovie("menuitem","item"+i+"_mc", i);
curr_item._width = childNodes.length;
if (direction == "horizontal") {
curr_item._x = x + i*curr_item._width;
curr_item._y = y;
}
if (direction == "vertical") {
curr_item._x = x;
curr_item._y = y + i*curr_item._height;
}
curr_item.trackAsMenu = true;
// item properties assigned from XML
curr_node = node_xml.childNodes[i];
curr_item.action = curr_node.attributes.action;
curr_item.variables = curr_node.attributes.variables;
curr_item.name.text = curr_node.attributes.name;
// item submenu behavior for rollover event
if (node_xml.childNodes[i].nodeName == "menu"){
// open a submenu
curr_item.node_xml = curr_node;
curr_item.onRollOver = curr_item.onDragOver = function(){
var x = this._x + this._width - 186.3;
var y = this._y + 26;
GenerateMenu(curr_menu, "submenu_mc", x, y, 1000, this.node_xml, "vertical");
// show a hover color
this.name.textColor = (0xFFFFFF);
var col = new Color(this.background);
col.setRGB(0x008185);
};
}else{ // nodeName == "item"
curr_item.arrow._visible = false;
// close existing submenu
curr_item.onRollOver = curr_item.onDragOver = function(){
curr_menu.submenu_mc.removeMovieClip();
// show a hover color
this.name.textColor = (0xCCCCCC);
var col = new Color(this.background);
col.setRGB(0x008185);
};
}
curr_item.onRollOut = curr_item.onDragOut = function(){
// restore color
this.name.textColor = (0x004445);
var col = new Color(this.background);
col.setTransform({ra:100,rb:0,ga:100,gb:0,ba:100,b b:0});
};
// any item, menu opening or not can have actions
curr_item.onRelease = function(){
Actions[this.action](this.variables);
CloseSubmenus();
};
} // end for loop
};
// create the main menu, this will be constantly visible
CreateMainMenu = function(x, y, depth, menu_xml){
// generate a menu list
GenerateMenu(this, "mainmenu_mc", x, y, depth, menu_xml.firstChild, "horizontal");
// close only submenus if visible durring a mouseup
// this main menu (mainmenu_mc) will remain
mainMenu_mc.onMouseUp = function(){
if (mainmenu_mc.submenu_mc && !mainmenu_mc.hitTest(_root._xmouse, _root._ymouse, true)){
CloseSubmenus();
}
};
};
// closes all submenus by removing the submenu_mc
// in the main menu (if it exists)
CloseSubmenus = function(){
mainmenu_mc.submenu_mc.removeMovieClip();
};
// This actions object handles methods for actions
// defined by the XML called when a menu item is pressed
Actions = Object();
Actions.loadSWF = function(targetMovie) {
if (section != targetMovie) {
section = targetMovie;
_root.transition.gotoAndPlay("closing");
};
}
Actions.newMenu = function(menuxml){
menu_xml.load(menuxml);
};
// load XML, when done, run CreateMainMenu to interpret it
menu_xml = new XML();
menu_xml.ignoreWhite = true;
menu_xml.onLoad = function(ok){
// create main menu after successful loading of XML
if (ok){
CreateMainMenu(1, 110, 0, this);
}else{
message_txt.text = "Error Loading XML";
}
};
// load first XML menu
menu_xml.load("menu2.xml");
// preload function and transition
this.createEmptyMovieClip("temp", 1000);
function preload() {
this.transition.txtPercentage = "";
temp.onEnterFrame = function() {
var t = this._parent.content.getBytesTotal(), l = this._parent.content.getBytesLoaded();
if (t) {
var percent = Math.round(l*100/t);
if (l == t) {
this._parent.transition.gotoAndPlay("opening");
this._parent.transition.txtPercentage = "Done Loading";
delete this.onEnterFrame;
} else {
this._parent.transition.txtPercentage = percent+" %";
}
} else {
this._parent.transition.txtPercentage = "";
}
};
}
the xml:
<?xml version="1.0"?>
<menu name="example">
<item name="MISSIE" action="loadSWF" variables="home.swf"/>
<item name="OVER het bedrijf" action="loadSWF" variables="shutter2.swf"/>
<item name="EXPERTISE" action="loadSWF" variables="shutter2.swf"/>
<item name="BENADERING" action="loadSWF" variables="shutter2.swf"/>
<menu name="WERK DAT WERKT">
<item name="Graphic Design" action="loadSWF" variables="graphics.swf"/>
<item name="Flash Design" action="loadSWF" variables="flash.swf"/>
<item name="CSS/HTML/JS" action="loadSWF" variables="css.swf"/>
</menu>
<item name="MENSEN" action="loadSWF" variables="shutter2.swf"/>
<item name="WERKEN BIJ het bedrijf" action="loadSWF" variables="shutter2.swf"/>
<item name="CONTACT" action="loadSWF" variables="shutter2.swf"/>
<menu name="MISSIE">
<item name="Graphic Design" action="loadSWF" variables="graphics.swf"/>
<item name="Flash Design" action="loadSWF" variables="flash.swf"/>
<item name="CSS/HTML/JS" action="loadSWF" variables="css.swf"/>
</menu>
<item name="Careers" action="loadSWF" variables="careers.swf"/>
<menu name="Downloads">
<item name="Application" action="loadSWF" variables="appform.swf"/>
<item name="Other Forms" action="loadSWF" variables="other.swf"/>
</menu>
<item name="Contact" action="loadSWF" variables="contact.swf"/>
</menu>[/quote]
Loaded Image.width Be Stage.width On Resize
Hello... I am trying to make a loaded image.width be the stage.width on resize... the same for the height... I'm tweening them also... and that seems to be working... well on the yx... not so much on the width.... If I use Stage.width directly in the tween it seems to not load the image... little lost here... thank you for any help...
jeremyBass
here is what I have which is the whole file
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
// ***Stage aligned top left
Stage.align = "TL";
// *** Stop the stage from scaling with the browser window.
Stage.scaleMode = "noScale";
Stage.showMenu = false;
stop ();
image_mc1.loadMovie("http://hellscanyonsportfishing.com/images/testhead.png");
image_mc2.loadMovie("http://hellscanyonsportfishing.com/Scripts/flash/bk.jpg");
image_mc1._quality = "BEST";
image_mc2._quality = "BEST";
// initiate postitions and scaling values for objects
v = Math.random() * 6 - 3;
v = Math.random() * 6 - 3;
var curStageheight = Stage.height;
var curStagewidth = Stage.width;
imageHolder._height = curStageheight;
imageHolder._width = curStagewidth;
//var xScaleT:Tween = new Tween(image_mc1, "_rotation", Elastic.easeOut, 0, 10, 4, true);
var xScaleT0:Tween = new Tween(image_mc1, "_x", Bounce.easeOut, 0, -2*v, 3, true);
var xScaleT1:Tween = new Tween(image_mc1, "_y", Bounce.easeOut, 0, -6*v, 4, true);
var xScaleT4:Tween = new Tween(image_mc2, "_width", Bounce.easeOut, imageHolder._width*1.1, imageHolder._width*1.15, 3, true);
var xScaleT5:Tween = new Tween(image_mc2, "_height", Bounce.easeOut, imageHolder._height*1.1, imageHolder._height*1.15, 3, true);
var xScaleT2:Tween = new Tween(image_mc2, "_x", Bounce.easeOut, 0, 0-2*v, 2, true);
var xScaleT3:Tween = new Tween(image_mc2, "_y", Bounce.easeOut, 0, 0-8*v, 2, true);
xScaleT0.onMotionFinished = function() {
this.yoyo();
};
xScaleT1.onMotionFinished = function() {
this.yoyo();
};
xScaleT2.onMotionFinished = function() {
this.yoyo();
};
xScaleT3.onMotionFinished = function() {
this.yoyo();
};
xScaleT4.onMotionFinished = function() {
this.yoyo();
};
xScaleT5.onMotionFinished = function() {
this.yoyo();
};
image_mc1._y = 0;
image_mc1._x = 0;
image_mc2._y = 0;
image_mc2._x = 0;
//create a listner that checks to see if the browser window is resized
sizeListener = new Object();
sizeListener.onResize = function() {
// change movieclip properties when the window is resized.
var curStageheight = Stage.height;
var curStagewidth = Stage.width;
imageHolder._height = curStageheight;
imageHolder._width = curStagewidth;
//create a random velocity for x and y direction
};
Stage.addListener(sizeListener);
Adjusting Text Tool's Width To Screen's Width
Hi all,
I'd like to know howshould I do to adjust text tool's width to screen's width automatically?
Because I want to insert my flash into a Visual Basic screen saver.
Regards,
Phil
Setting Symbol Width To Winodw Width
If I have an swf that contains two rectangles, how could I set the width of one of them to that of the window while maintaining a preset value for the other?
Changing Width Of Sprite Changes Text Width
G'day everyone
I am currently creating an object called MyTextField (which extends Sprite) and then I set the width of this instance to a value.
The sprite class has several TextFields within it.
The problem i am having is that when I change the width it affects the size of the text as well. Too large and the text looks stretched, too small and the opposite happens.
What I want to know is, is there a way I can set the width of MyTextField without it affecting the size of the text.
This is the code i'm using for my textfields
Code:
var label:TextField = new TextField();
label.autoSize = TextFieldAutoSize.LEFT;
label.multiline = true;
label.background = false;
label.border = false;
label.wordWrap = true;
label.embedFonts = true;
label.type = TextFieldType.DYNAMIC;
label.selectable = false;
label.antiAliasType = AntiAliasType.ADVANCED;
label.defaultTextFormat = this["format_" + label_type];
label.addChild(label);
label.htmlText = info;
and the format is here
Code:
this.format_heading = new TextFormat();
this.format_heading.font = "Verdana";
this.format_heading.color = 0x000000;
this.format_heading.size = 10;
this.format_heading.bold = false;
this.format_body = new TextFormat();
this.format_body.font = "Verdana";
this.format_body.color = 0xff0000;
this.format_body.size = 10;
this.format_body.bold = false;
Any help would be super
Cheers
Lango
Radiobutton?
sup all,
this is what im trying to do...
i have a quiz that im trying to make, now i want you to be able answer the question with one of the 4 answers. say theres 10 questions in all.
how do i make it so that after you click in a radio button it logs that info so you can move onto the next question?
then after all 10 questions are answered it gives the score.
thanx in advance
RadioButton Help
Hey,
I m having issues with radioButtons , due to the fact that I m unsure how they work!
I hope someone has the time and energy to help me, appreciate it a lot.
Oki here is the deal.
I want to have 3 radioButtons so they become a scale from 1 - 3, meaning there will be a question and they will answer on a scale from 1 - 3.
So all the radioButtons belong to the same groupName = radioButton.
Now what I need to do is to make sure that the button that was marked will be posted.
So if I gave each of the radioButtons and instance name , lets say g1, g2, g3:
i would need to type in my script the following:
my_vars.g1 = g1.radioButton ?
my_vars.g2 = g2.radioButton ?
my_vars.g3 = g3.radioButton ?
But how do I know which one the user marked? I only want to send through php, the marked button!
Should I do an If condition?
Hopefully someone can guide me through this!
Best Regards
Tom
Attach Code
stop();
System.useCodepage = true;
send_btn.onRelease = function() {
my_vars = new LoadVars();
my_vars.fnamn = fnamn_box.text
my_vars.enamn = enamn_box.text;
my_vars.tele = tele_box.text;
my_vars.mobil = mobil_box.text;
my_vars.sender = email_box.text;
my_vars.message = message_box.text;
if (my_vars.sender != "" and my_vars.fnamn != "" and my_vars.enamn != "" and my_vars.tele != "" and my_vars.mobil != "" and my_vars.message != "") {
my_vars.sendAndLoad("mailer.php", my_vars, "POST");
gotoAndStop(2);
} else {
error_clip.gotoAndPlay(2);
}
my_vars.onLoad = function() {
gotoAndStop(3);
};
};
email_box.onSetFocus = fnamn_box.onSetFocus = enamn_box.onSetFocus = tele_box.onSetFocus = mobil_box.onSetFocus = message_box.onSetFocus=function () {
if (error_clip._currentframe != 1) {
error_clip.gotoAndPlay(6);
}
};
Radiobutton And Php
Hi everyone,
I'm trying to make a flashform using textfields and radiobuttons to be mailed via php.
The textfields are coming through fine, but I can't get the radiobuttons to work. I think I need to assign variables to them but how do I do that?
Also, how would the php look?
thanks
RadioButton Help
Wassap guys m sort of learning how 2 manipulate radioButton using action script n m developing an application usin' it, i choose it but not checkBox coz radioButton allows u to make only 1 selection
now m kinda stuck coz within d 3 multiple chioices i only want 2 allow d user 2 select only 1(which might b rite or wrong) and after tht i want to disable all d radioButtons, so tht he won't keep selectin' around until he gets d rite answer
can somebody help me out!!!
Radiobutton And Php
Hi everyone,
I'm trying to make a flashform using textfields and radiobuttons to be mailed via php.
The textfields are coming through fine, but I can't get the radiobuttons to work. I think I need to assign variables to them but how do I do that?
Also, how would the php look?
thanks
Radiobutton Feedback
Hi - I'm having hellish problems trying to use radio buttons in the following:
I've set up a simple quiz thus...
A question, followed by three radiobuttons (all with distinct _names) for the multiple choice, and finally an ordinary button for the user to submit their chosen answer.
If the answer is correct I need the user to be taken to the next question (or frame number 'whatever'), and if incorrect I need then to be taken to a 'try again' frame.
So... does any kind (and clever) person know how I get the 'submit' button to evaluate which radiobutton has been checked; so I can use that info to take the user to the next appropriate stage?
I'm using the radiobutton smartclips that come with v5 - and they seem to function just fine visually - but I just can't work out how to use them in the above, actionscripting context.
Any help hugely appreciated!
Fran
Radiobutton Smartclip
hi,
Im trying to use the radio button smartclip. I want the user to be able to select any combination of buttons within a menu of them and have more than one menu If I try to put a radio button in a movie clip I can't delect it and when they are on the main timeline, they work but I can only select one at a time.
What should I do?
thanks
Could Anybody Help Me With This RadioButton Problem?
Hi,
I'm having a silly problem here. I'm building a small dialog box that contains 3 sets of radio buttons. They are nicely arranged in 3 groups and assigned to "group1, group2 and group3 respectively.
The buttons have "data" values associated with them (0, 1, 2, 3 etc.)
When I open that dialog, I want to set the radio buttons so that they show the *current* values of something. However, consistently, this doesn't work. If I set one of the buttons to be ON by default (in the properties dialog) then this button will be on, no matter what I do. If I don't set a default, all of them will be off.
I've tried a number of different approaches to set the buttons and none worked. Here is my latest one: (the dialog is a movieClip with instance name "noteProperties")
<pre>
function showNoteProperties(note) {
createNotePropertiesDialog(x,y);
// populate it with data
noteProperties.noteName = note; // this works!
hlp = getPriority(note);
trace("priority = " + hlp); // yes, it gets the right data
var p = "p" + hlp;
noteProperties[p].setValue(true);// don't know why this won't work using the buttongroup
(...)
}
</pre>
I obviously give the radio buttons names such as p0, p1, p2 etc. The next group is called c0, c1, c2...
So this approach doesn't do it. I've also tried this one:
<pre>
noteProperties["group1"].setValue(2);
</pre>
and that didn't work either.
What's going on here? Does anybody know?
Thanks,
Juggle5
Radiobutton Quiz
sup all,
this is what im trying to do...
i have a quiz that im trying to make, now i want you to be able answer the question with one of the 4 answers. say theres 10 questions in all.
how do i make it so that after you click in a radio button it logs that info so you can move onto the next question?
then after all 10 questions are answered it gives the score.
thanx in advance
::radiobutton Properties
Hi,
I am using radiobuttons on my privatepage and they look really a little bit boring. I want to change the appearence: font etc.
How to do that??
And what about rollovers: Is there a possibility to do so???
Omitofo
Stay true
::Attila::
RadioButton And Deselection
How do I deselect a radio button programmatically?
I tried this:
radioButton1.selected = false;
That did not work.
Help
Raymond
MX Radiobutton Problem
hy everybody!
here is my problem:
I cant identify the clicked radiobutton at the handler function just because the parameter doesnt give me an instance of it.. I just got an [object object] thing in the parameter and i cant get the _name property of it.
thanks in advance!
cbaristo
excuse my english please!
Radiobutton On MX To Flash5
Hi.. soryy for my bad english
i made a form by usin FlashMX but when i browse it there seams problems about flash players.. so i export my document to Flash5 but my radiobuttons that i used in the form disabled. How can i solve this problem. is it inpossible to use radio buttons in Flash5..
Radiobutton Help Needed
little assistance needed with taborden radiobutton...
I've got a couple of inputtextfields and radiobuttons on a form. I've set tabEnambled and tabIndex for all instances. All seems to work fine with one exception. It does not seem possible to tab from radiobutton 1 to radiobutton 2 if they have the same groupname! If they are not in the same group the tabIndex will do its work and tab from radio 1 to radio 2....
How do I solve this? I've tried almost everything....On one forum thay suggested to use Deluxe Taborder but since that is a smartclip it isn't an option...
can anybody help ??
RadioButton CreatClassObject
When I try to create a RadioButton with the createClassObject method inside of a movie above _level0 (_root) it simply will not create the dang thing. When I try to create a CheckBox I have no problems.
Code:
_level0.content.createClassObject(RadioButton, "s" + (i + 1), $depth++, {label:$choices[i].text, labelPlacement:"right", selected:"false", groupName:"choice_group"} );
Does anyone have ideas on why this is happening?
Radiobutton Help Needed
I'm trying to set it up so that when I person selects a radio button and clicks a pushbutton an off screen object will appear on screan with for instance an X coordinate of 25 and Y coordinate of 50.
my radio group is called "radiogroup" and my push buttons Click Handler is "onClickit" one of the objects/symbol/movieclips I have has the instance name of "car".....I'm not quite sure how to set this up in the action scripting or what to put in the data section of the radio button.....any help with this would be greatly appretiated.
Thanks - Mike
RadioButton Var Problem
I have a emailform with two textfields and two radio buttons.
The script behind the button send variables in form movieclip to email PHP page which will send the mail to myself.
---------------------------
on (release) {
form.loadVariables("email.php", "POST");
}
---------------------------
Everything work, BUT... how xcan I give the radio button a "Var".
Bercause, my php script read the vars from the form movieclip.
I hope someone can give me a good solutions...
Thanx!!!
Funfair77
Radiobutton Urgent Help
Hi,
I need some help with this component, i need make a count with this, after 3 click show a mensage or disable the radiobutton is it's possible.
I already make a count with combobox at star and end the code and its ok, but i cant do this with radiobutton.
Someone help me pls.
RadioButton Vs GroupName
Hi,
I need some help, i have a multichoice quiz, 10 questions with 10 possible answers (100 options), i need work with the groupname somethink like: if the group 5 getvalue = false show mensage.
Help me pls!
Look If Many Radiobutton Is Select
I have ten radiobutton that I like to see if everyone is selected.
then name of the radiobutton is
question1, question2, question3, question4...............
if everyone is selected I like to make a button enable.
I dont like to create a lot of code to control if they are selected so what can I do to make it so little as possible
RadioButton - What Am I Doing Wrong?
This code creates on object instance of the RadioButton component on the stage at runtime but RadioButton does not show a label, does not have a red dot, does not toggle, does not trigger my function when clicked. groupName seems to work and so does x and y placement. I'm developing in flash 8 environment and my publish settings are set to Flashplayer 6 with Actionscript 2. Any help will be appreciated.
Code:
function featureLayout() {
x1 = 30;
x2 = 195;
x3 = 360;
x4 = 525;
y = 75;
spacing = 21;
for (i=1; i<=featureCount; i++) {
if (productFeature[i] != "null"){
attachMovie("FeatureText", "FeatureText"+i, i);
var name = "FeatureText" + i;
name = eval(name);
name._x = x1;
name._y = y;
name.featureName.text = productFeature[i];
}
if (productFeature[i] == "null"){
offsetMinus = i - 1;
createClassObject(mx.controls.RadioButton, "radioButton4"+offsetMinus, i+20);
var radio1 = "radioButton4"+offsetMinus;
radio1 = eval(radio1);
radio1.groupName("Feature"+offsetMinus);
}else{
createClassObject(mx.controls.RadioButton, "radioButton1"+i, i+20);
var radio1 = "radioButton1" + i;
radio1 = eval(radio1);
radio1.groupName("Feature"+i);
}
radio1.move(x2, y+3);
radio1.setStyle("symbolColor", 0xff0000);
radio1.setSize(155);
radio1.label = eval(productOption1[i]);
radio1.data = eval(productCode1[i]);
radio1.click = function(){
submitChoice();
}
radio1.toggle = true;
if (productFeature[i] != "null"){
_root.attachMovie("Advice", "Advice"+i, i+110);
var AdviceButn = "Advice" + i;
_root.AdviceButn = eval(AdviceButn);
//_root.AdviceButn._height = 20;
_root.AdviceButn._x = x1;
_root.AdviceButn._y = y-3;
_root.AdviceButn.AdviceText = productAdvice[i];
_root.AdviceButn.featureText = productFeature[i];
_root.AdviceButn.x = 435;
_root.AdviceButn.y = y;
}
y = (i*spacing)+75;
}
}
RadioButton And Styles
Hi,
This is probably quite a simple thing, but I have searched everywhere for an answer and can't find anything.
I have a radiobutton group with radiobuttons, I want to assign a font to the radiobuttons which wont be on the clients computer, I have tried using the textformat:
var tf:TextFormat = new TextFormat();
tf.color = 0xCCCCCC;
tf.font = "BankGoth";
tf.size = 11;
group11.setStyle("textFormat", tf);
group12.setStyle("textFormat", tf);
group13.setStyle("textFormat", tf);
Where group11,12 and 13 are the instance names of the radiobuttons and BankGoth is a font I have added to the library.
But it doesn't work, can anyone help me please?
Many Thanks in advance.
Iain
Look If Many Radiobutton Is Select
I have ten radiobutton that I like to see if everyone is selected.
then name of the radiobutton is
question1, question2, question3, question4...............
if everyone is selected I like to make a button enable.
I dont like to create a lot of code to control if they are selected so what can I do to make it so little as possible
Get Radiobutton Group Value.
Hi guys,
I am creating a simple AS3 contact form.
Most of it i have done but i am having a bit of bother getting the value of the radiobutton group.
Anyone?
Thanks
Paul
|