ActionScript 2.0 :: HitSize MC - Width Variable Not Working

Jun 19, 2008

I have an mc that loads thumbnail images which are then displayed sequentially in a scroller. I have an array that contains the individual widths of the images and i can get them correlating to the specific images. However: when I try to change the hit size of the images (controlled by a hitSize mc which is just a red box) it won't change the ._width of the hitSize mc according to the variable.

This is what I can do:
Code:
hitSize._width = 100;
(which works)

This what I have:
Code:
hitwidth = _root.projectsB[this.menuNum]; //this is the individual width of the image being loaded
hitwidth = this.hitSize._width;
if I trace(hitwidth); I get the correct number, but the above code won't change the size of the mc.

View 4 Replies


Similar Posts:


ActionScript 2.0 :: % Width Of .swf Not Working In Table Of 100%

Oct 18, 2005

When I create an .swf at 60% width it expands fine to the width of the viewport/browser that I wanted. But when I add a table container of 100% width it doesn't show up at all, it turns invisible....??? Something very novice that I can't see to grasp. I've tried noscale and fscommand...but to no avail.[code]

View 3 Replies

ActionScript 3.0 :: Width And Height Tweens Not Working?

Dec 13, 2009

The object is then tweened starting from a large number and going to a small number.  Except my tweens aren't working.  From the trace statements, my objects are shown to end up being to x=-20.55 and y=-107373766.65.
 
My code:
  
package {
import flash.display.*;
import flash.events.*;
import flash.utils.Timer;

[code]....

View 7 Replies

Flex :: Tile Layout Not Working With 100% Width?

Apr 21, 2011

I have a list with tile layout,I have given the item renderer's width as 100%, but the item dosen't resize to fit the content . The same scenario works well for horizontal and vertical layout.

My code looks like this

<s:List width="{this.width}" dataProvider="{allActionsArrList}">
<s:layout>
<s:TileLayout />

[Code]....

View 1 Replies

ActionScript 3.0 :: Sprite Width Not Working For Image?

Jun 21, 2009

I create a simple .As file with following score code:
Code:
package{
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.net.URLRequest;
public class AS3_Project1 extends Sprite{
private var sprite:Sprite;
[Code] .....
And the image wont appear but if i remove the sprite.width = 500; line and I can view the image? what going on?

View 3 Replies

Flash 10 :: Bitmaps Less Then 4px In Width / Height Not Working?

Aug 23, 2010

I've come to notice recently while using bitmap objects in the Flash CS5 (maybe before as well) authoring environment that are less than 4 pixels in width and/or height that they are treated as though they are 4 pixels wide/tall. Many of the bitmaps I use are 1 px wide in one direction or the other, and they are stretched to fill an area. Lets say I have a bitmap that is 20px tall and 1 px wide, and I stretch it to be 100px wide. The "hit area" of the object, or parent objects that contain it, is 400 px wide. So even if you click a significant distance away from the object, it is still selected, and anything underneath that invisible area can't be selected.

I've also noticed that when exporting a frame as an image, the smallest the width/height may be is 4px, and when I click the Edit button in the Properties panel with a Bitmap instance selected, it opens up in Photoshop CS5 and is 4 pixels wide! I'm wondering if for some reason Flash can't handle bitmaps less than 4 pixels in width/height and is treating it as if it IS 4 pixels wide, possibly even adding 3 extra columns of transparent pixels, because if I do the same thing manually, naturally it acts identical to the way Flash treats the 1px wide version. But why? Why can't Flash handle small bitmaps? Seems to me that's more efficient than quadrupling the amount of memory required.

View 0 Replies

ActionScript 3.0 :: HTML 100% Width And Height Not Working?

Nov 30, 2009

I would like my website [URL] to be fullscreen and I've found this code to make it.But I am having problems with Firefox - the screen doesn't load anything, it is just a black screen. And in some IE the swf appears in a little square (very small) and not the size it was supposed to be in a maximized screen. The compatibility button on IE8 fixes it, but not everybody knows about this button..

HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

[code]....

View 1 Replies

Flex :: Horizontallist Variable Width?

Feb 25, 2010

i want to populate a horizontalList component from a xml file, the width value will be inside the xml file as well with all the data.actually i have this code:

<mx:Model id="epg" source="epg.xml" />
<mx:Component id="customRend">
<mx:Label text="{data.description}" width="{data.width}"/>

[code].....

View 1 Replies

ActionScript 2.0 :: Variable Width LoadBar?

Sep 12, 2007

I have a loader mc which scales to the width of the Stage. The loader mc has 3 nested mc's.A bg mc, progressBar mc, and loadBar mc.The loader and all nested mc's scale properly when I test it in the flash IDE but once I place the swf in a html page then the width is not accurate anymore. Another issue is since the loader stretches across the stage it needs to resize correctly in fullscreen mode. Click here here to view the example

// This is the code
// ----- [ Stage Align ] ----- //
Stage.scaleMode = "noScale";

[code].....

View 3 Replies

Html :: Width 100% For Divs, Table Not Working On Mozilla And Ie

Apr 27, 2011

width 100% for divs, table not working on mozilla and ie. can anybody share their experience while working to achieve this. I wanted to place swf to occupy full web page

View 1 Replies

ActionScript 3.0 :: Setting Width And Height Not Working But ScaleX And Y Are?

Sep 28, 2009

let me know what i am doing wrong here. this DOES NOT WORK.

ActionScript Code:
//add image
imageLoader = new Loader();

[code]......

View 2 Replies

ActionScript 3.0 :: Why Aren't Width & Height Tweens Working

Dec 13, 2009

An object has been attached. The object is then tweened starting from a large number and going to a small number. Except my tweens aren't working. From the trace statements, my objects are shown to end up being to x=-20.55 and y=-107373766.65.

[Code]...

View 0 Replies

ActionScript 3.0 :: 100% Width And Height Not Working When Compiled With Mxmlc

Jan 30, 2010

I'm compiling for the first time with mxmlc.exe from the command line. The compilation is successful, and the SWF plays if I set specific pixel sizes for width and height in my HTML wrapper. However, if I set the sizes to 100%, the SWF is not loaded (and right-clicking on the page yields the regular Firefox menu instead of the Flash menu).

Here's my HTML.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

[Code]....

View 1 Replies

ActionScript 2.0 :: Tween Width & Height Simultaneously Not Working?

Nov 10, 2010

Code:
var tween2:Tween = new Tween(_root.img_fake_mc, "_rotation", Strong.easeOut, target._rotation, target._rotation-90, 10, false);

[code].....

View 1 Replies

ActionScript 3.0 :: Load Xml Images With Variable Width?

Aug 6, 2010

i wanto to load several images from xml but with a variable with and keeping the same space between them...

import flash.display.Loader;
import flash.net.URLLoader;
import flash.net.URLRequest;

[Code]....

View 2 Replies

ActionScript 3.0 :: Dynamic Buttons With Variable Width?

Jun 1, 2011

I'd like to create a tab system where the tab text is populated by an external XML file, and the tab width is based on whatever the width of the text is.

I couldn't just use button symbols because when I resized them the text got squished

View 2 Replies

ActionScript 2.0 :: Find The Width Of A Text Box And Set A Variable With That Value?

Sep 3, 2003

how do i find out the width of a text box and set a variable with that value?

View 1 Replies

Flex :: Width And Height Specified In Percentage Not Working For Children Of A Viewstack

Sep 30, 2011

I have a ViewStack which is dataProvider for a TabBar. There are two VBoxs as children for this ViewStack. It works fine with absolute values for width and height for these VBoxs, but when specified in percentages, the VBox uses all the available space (100%) for any percentage value. find the code and screen shots below.

how can children of a ViewStack be aligned to center? There is no horizontalAlign property for ViewStack and it is not working with horizontalCenter= "0".

Code:

<mx:ViewStack id="viewStack" width="100%" height="100%" selectedIndex="0" horizontalCenter="0" textAlign="center">
<mx:VBox label="Tab 1" width="25%" height="10%" borderThickness="2" borderColor="red"

[Code]....

View 2 Replies

ActionScript 2.0 :: Dynamic Textfield With Fixed Height But Variable Width?

May 23, 2008

How can i make a dyn textfield with fixed height but variable with width?

ps what is the difference between

Code:
var pageContent:TextField;
vs
var pageContent:TextArea;

View 5 Replies

Variable Checking Isn't Working?

Jul 14, 2009

Google is ranking my site preety high BUT (bigBut) in MOST searches it lists my swf-s not html pages. So when clicked they are shown in a browser window as single swf-s, not as part of html page. I am trying to workaround this by means of some variable to inspect if swf is opened as standalone or within a html.Here is the problem. I've set up a swf (swf_01 for example) in html page that loads another swf (swf_02) which is in swf_s directory. Swf_01 establishes a variable _global.isActive = 1; when html loads swf_01. So if swf_02 is loaded into the swf_01 variable is TRUE and that is OK and if the swf_02 is loaded directly from search results as a standalone swf it's not OK. That works so far. In swf_02 there is a code that checkes if variable is undefined (meaning that swf is loaded directly from search results) and, if it is, loads the right html into "_self".Somehow it's not working. Maybe my code isn't right.

Code in swf_02 (loaded one):
/if(isActive==undefined){ loadMovie("http://www.mydomain.com/index_services.htm", "_self");} // meaning: if variable is not true > this swf is loaded into browser directly from search

[code]....

View 7 Replies

ActionScript 3.0 :: Using This[] To Reference A Variable - Not Working ?

May 2, 2010

I'm writing a function which can take the names of different variables and use them to do some calculations. Long story short, I want to be able to call the function like this:

It probably seems like a really roundabout way to pass the variable through its name rather than just passing the variable itself. This is related to me using XML to get the variable names, so they come in as strings. Just bear with me here.

Inside the function, I want to be able to do something like this:

which should then trace the variable's value. Unfortunately, I just get an 'undefined'. How do I use 'this[]' to get the value of the variable from a string corresponding to the variable's name?

View 6 Replies

ActionScript 2.0 :: [CS3] GotoAndStop (variable); Not Working?

Feb 13, 2009

I have a simple 3 frame file.

Frame 1 (main code, aka: the problem area)
Frame 2 (gotoAndPlay (1)
Frame 3 (Content Frame, aka: destination)

The concepts I'm trying to understand are two-fold: Creating Variable, and Loading them externally.

Here's my code:

Code:
var varFrame: Number;
var my_lv:LoadVars = new LoadVars();
my_lv.load ("external_code.txt");

[code]....

I can get the project to return the number "3" to the output window, but I can't get gotoAndStop (varFrame); to work.I understand this is a pointless program, but the project I'm building for work uses all these same lines of code (almost).

View 5 Replies

ActionScript 3.0 :: Using This[] To Reference A Variable Not Working?

May 2, 2010

I'm writing a function which can take the names of different variables and use them to do some calculations. Long story short, I want to be able to call the function like this:

function caseConditionEvaluator( nameOfVariable:String )

It probably seems like a really roundabout way to pass the variable through its name rather than just passing the variable itself. This is related to me using XML to get the variable names, so they come in as strings. Just bear with me here.

Inside the function, I want to be able to do something like this:

trace( this[nameOfVariable] )

which should then trace the variable's value. Unfortunately, I just get an 'undefined'. How do I use 'this[]' to get the value of the variable from a string corresponding to the variable's name?

View 3 Replies

ActionScript 3.0 :: [FDT] Refactor Variable Not Working?

May 26, 2010

Just taking my first stumbeling steps from Flex Builder towards FDT.As I understand refactoring should work much like in Flex Builder, but when I select a variable for refactoring the dialog box shows the name of the class and if I click OK the class (the current .as file) is renamed and not the variable.No matter what I try I can only refactor the class name.

View 1 Replies

ActionScript 1/2 :: Variable On Input Text Not Working With If / Then?

Mar 25, 2009

I'm using ActionScript 2.0 with Flash CS4 Professional, andI'm running into conflicting info on how to do this depending onwhich Flash book I'm looking at (and is that really a surprise?).1) I want the user to type text into a text field and thenFlash places what they've typed into a variable.So I created a text field of the type 'Input Text' andassigned this variable 'myInput'2) When the user presses a button, I want Flash to look atwhat is in the variable. THEN... If they have typed the correctword, they are sent to frame 19. If they type anything else, theyare sent to frame 38.In this example, the correct word is: "move"So, I placed this script on the button:

on (release) {
trace(myInput);
if (myInput = "move") {

[code]........

View 4 Replies

Flex :: ChangeWatcher On A [Bindable] Variable Not Working?

May 26, 2011

I have a Number variable, named isConflict, whose value is passed in from a parent. I would like to put a ChangeWatcher on this item so that a function named changeBGColor will run whenever the value is changed. Within my creationComplete function of init, i have the following:

var isConflictWatch:ChangeWatcher = BindingUtils.bindSetter(changeBGColor, this, "isConflictChain");

View 1 Replies

ActionScript 2.0 :: Variable As A Function Parameter Not Working?

Jan 28, 2010

I have a function with three parameters, that works fine when I type in the parameter values. The function is tweens(MCname, targX, targY) and it runs properly when I use tweens(btn1, 150, 200) for instance. I need the function to move 6 different movie clips, one at a time, and I am using a variable (Counter) and an if statement to tell the function to run again after one of my tween classes finishes. The code all works, and it will run six times with the same clip if I just type in one of the movie clip's instance names as the MCname parameter. BUT, if I try to use a variable (BTNname) to serve as the MCname parameter, it will not work, making it so I cannot apply the function to my 6 different movie clips. I put a trace on the MCname parameter, and it returns the correct value (btn1, btn2, btn3, etc) but it is not moving the corresponding movieclips. I've tried a number of different methods, but nothing will work..[code]

View 4 Replies

ActionScript 2.0 :: Variable Value Not Working In Button Menu?

Dec 14, 2005

Im creating a menu navigation, which loads a sub menu movie clip from the library on specific button press. It does this by looking at the current selection (a number variable) and closing the currently active submenu. Once loaded it then changes the number variable to the value of the current submenu.

This works fine, most of the time... sometimes the number variable and menu loaded is completely wrong.

There are six buttons on the menu bar, included is sample script from the 'About' button, there is more to the script but it is instances of this sample, only button names etc change.

Code:
about_btn.onRelease = function() {
if (navID == 1) {
_root.submenuHome_mc.gotoAndPlay("close");

[Code]....

View 1 Replies

ActionScript 2.0 :: Loadmovie - Random Variable Not Working

May 16, 2002

The tutorial in The Best of Kirupa isn't working for me! When I try doing this:

rn = Math.round(Math.random()*1000000);
loadVariablesNum ("flashdata.txt?reload="+rn,0);

I get a debug error: Error opening URL "file:///C|/pathtofolder/flashdata.txt?reload=263757" Where the reload variable is the random number and flashdata.txt is the file that contains the variable I need.

View 9 Replies

Actionscript 3 :: Canvas Total Width (visible Width + Hidden Scrollable Part)?

Apr 19, 2010

It's probably a no brainer, but I've spent the last 40 minutes or so looking for it to no avial.

I have a Canvas control with a fixed width and a horizontal scrollbar.I'm trying to find the actual width of the control.The .width (fixed width) + the part being revealed by the scrollbar.I tried explicitWidth, width + maxHorizontalScrollPosition, and some other combos but non of them hit the spot.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved