ActionScript 2.0 :: Attach Clips In Multiple Columns With Varying Heights?
Dec 28, 2009I'm used to doing something along these lines to attach clips in columns:
Code:
var columns:Number = 4;
var space:Number =150;
[code]......
I'm used to doing something along these lines to attach clips in columns:
Code:
var columns:Number = 4;
var space:Number =150;
[code]......
i'm trying to figure out how to reset or refresh clips that are dynamically attached to another clip based on records returned through xml.asically if the user chooses a different filter for the database query I need to be able to refresh a scrolling list made up of clips which will be different based on the filter.this is what I have for a function. I try to use "attachEmptyMovieClip" but to no avail
Code:
getAll=function(){
members = getMembers.firstChild.childNodes;
[code].....
I want to load random movie clips into an area... kind of like ads. but each of them is a different length, so at the end of whatever clip, it has to be able to move onto another randomly loaded clip.
and for the kicker... it'd be nice to be able to add a button of some kind on the individual "ads" that will allow the user to skip to another randomly loaded ad as if that ad had reached the end of it's time.
add multiple instances of an object to the stage at different but not random points.
For example - I have a box that is linked to a class file. In the class file I have an "ADDED_TO_STAGE" event listener. The function that is called places the box at a certain position on the stage say.... x=100, y= 200.
In the document class I create an instance of it like so -
_box:box = new box();
addChild(_box);
Now what I want is to create multiple instances of box on the stage every 5 seconds. But I don't want them all to spawn at (100,200) on the stage. But here's the catch, I don't want them to be random spawns either.
for ex- I want the first instance of box to spawn on (100,200), then 5 seconds later, the second instance to spawn at (200, 800), the third at (100, 500) and so on.
Would it be possible for me to create objects on the stage to serve as reference points for where i want the instances to spawn instead of writing the exact co-ordinates?
I'm trying to position dynamically generated movie clips into rows and columns. Currently i've managed to position them side-by-side using the same ._y position. I would like to position them into a grid consisting of 25 columns and 16 rows, so mc 26 would sit beneath mc 1 etc...
View 9 RepliesI have a single text field that attaches numerous lines of text. Because each line has an individual hyperlink, I'm using += and a for loop to append the next line. Here's the problem... When the text reaches the bottom it keeps going past the viewable area instead of becoming a new column - obviously by default. I know I can use scroll bars and all that mumbo jumbo, but having several columns is the way the client wants it.
View 3 RepliesI have multiple datagrids with about 10-15 columns total. I have a numeric sortCompareFunction for each column. At the moment, I have a separate function for each sort compare I do....each does the sorting numerically. I'm guessing I could condense functions sort1, sort2, sort3, etc into 1 function but I can't figure out how:
private function sort1(obj1:Object, obj2:Object):int{
var value1:Number=(obj1.zip==''||obj1.zip==null)?null:new Number(obj1.zip);
var value2:Number=(obj2.zip==''||obj2.zip==null)?null:new Number(obj2.zip);[code]...............
I have this code that I've used before to dynamically attach a movieclip to create one long list of movieclips, however for a design I'm working on I need to be able to create multiple columns of 4 (configurable) items so the 5th items get's a new _x position, and starts over calculating the _y position.
Code:
var x:XML = new XML();
x.ignoreWhite = true;
var thumb:Array = new Array();
var thumbTitle:Array = new Array();
var thumbDesc:Array = new Array();
[code]...
I have a datagrid with multiple columns. I can click a column header to sort the rows, but I don't know how to sort on two or more rows. For example, last name, age, then racing time.
View 1 RepliesI'd like to set up a 2 column, multi-row text box where a user/viewer could input text strings in and upon completion the text could be sent off, retaining its columns/rows, via email. This is on a page where clients can see a window dub of their videos and use one column to enter a timecode number(i.e. 1;03;25;23 or just 24;25) and the next to make comments.
I was thinking of two text input boxes- side by side, and then using some sort of dynamic arrays to create/push new input text boxes after a hard return is entered, but I can see all sorts of problems with that...
And I'm not sure if a data grid box component even accepts input text or whether a table would work etc. So I was wondering if you folks out there might have an idea as to the best approach for me to at least start researching or a on-point tutorial that covers this situation, etc.
I'm trying to create a Flex DataGrid where the firstname and lastname are shown under each other, but in the DataGridColumn
Ideally I would want to do something like
<mx:columns>
<mx:DataGridColumn headerText="Column 2" dataField="time"/>
<mx:DataGridColumn headerText="Column 2" dataField="firstname,lastname" itemRenderer="renderers.FirstNameLastName"/>
so that both values get passed to the itemrenderer, is this possible?
I'm trying to attach clips based on elements in an array. then when all the clips are attached, i'm using setinterval to have the attached clips slide onto the stage and stop in a row.the name of the dyamically attached clip isn't tracing in my function (the one with interval set).
Code:
stop();
import mx.transitions.Tween;
import mx.transitions.easing.*;[code]...........
I want to save remotely (on a database) the state (visible columns, columns width and order) of a Flex3 DataGrid.For width and visibility I can simply save them by accessing each column attribute.. But for the order? Do I have to create the dataGrid dynamically?
View 2 RepliesI have 5 text files that contain a list of 50 items in each file.
I want to bring that information into a datagrid; 1 column per text file. I'd also like to extend the code to add more columns when new files are created.
I was able to bring in one column, but maybe an approach with xml, an xml connector and dataset would be better.
Here is the code so far:
Code:
var PATH:String = "10-12-09.txt";
var extIndex:Number = PATH.lastIndexOf( '.' );
var extless:String = PATH.substr( 0, extIndex );
[Code].....
I'm trying to find the way to attach the same actionscript to multiple buttons(over 100 buttons) at one time, instead of copying and pasting the actionscript in every frame. I have over 100 buttons as a seperate object in the library. In timeline, there are 100 keyframe, that each frame contains one button. Each instance is from one button. I don't want to write a same actionscript in for every button object. Is there anyway to get around that?
View 2 RepliesI have created a map (1 frame movie) at Flash MX 2004, that each area is a movieclip. Each movieclip has a unique name. I am trying to dynamically attach events to each movieclip, by reading their corresponding names from an XML file, with the following code:
Code:
areas_xml = new XML();
areas_xml.onLoad = initAreaBtns;
areas_xml.load("map_data.xml");
[Code]....
As you can see I am trying to create a roll over effect for each area/movieclip. The problem is that only the last movieclip is affected.
[Code]...
I am adding a mc to the stage (linkage name: SavedTopic) via mouse click calling this function. There will be a random number of these clips, based on user decisions. How can I set the 'savedTitle' and 'savedText' as variables unique to this specific MC, that can be accessed later via textbox inside the 'topic' movie clip. I've tried:
[Code]...
I'm trying to find the way to attach the same actionscript to multiple buttons(over 100 buttons) at one time, instead of copying and pasting the actionscript in every frame.I have over 100 buttons as a seperate object in the library. In timeline, there are 100 keyframe, that each frame contains one button. Each instance is from one button.I don't want to write a same actionscript in for every button object.
View 2 RepliesI have this code to use to pause animations in different areas of a .fla, for each pause I have been copying this and changing the "var timelinePause" and other items as shown after the original code, is repeating this code for each pause just junk code? is there something else from this that I can use to pause?
[Code]...
I have used AS2 for a long time, and have decided it is time to start working with AS3. When attaching multiple movieclips with instance names I would normally do this (AS2)[code]...
View 2 RepliesI am having problems with attaching multiple instances of the same mc, and tring to get an onMouseDown event for each of them.
The problem is that if I mousedown on one of the attached mc's, then all the attached mc's will trigger the onMouseDown event instead of only the one I clicked on.
the trace returns "onMouseDown called on 1" ...."n" instead of a single trace statement.
code:
function createSlideIcons(num){
var targetMC:MovieClip = this.form1.slideNav.slider;
var spacer = 5;
[Code]....
I am using attachSound to attach multiple sound through the library into different variables. But when I try to use setVolume, I get the same volume for all the sounds playing at that time.
View 8 RepliesI have multiple movie clips on stage (all in separate layers, of course) as well as buttons on stage to play each movie clip. There are buttons inside each movie clip. The problem is that the buttons inside the top layered movie clip work, but the others in the movie clips below don't.
View 2 RepliesI have the following code, which works beautifully when all the boxes are the same height. The basic point is that I have three boxes on the stage, 10 pixels apart. If you click and drag those boxes above or below each other, they reorganize themselves.
// based off Dynamic Stacking AS3 @ http://blog.soulwire.co.uk/code/open-source/dynamic-stacking
var mcArray:Array = [mcA, mcB, mcC];
var mcSpacing:int = 10;
[Code]....
I'm loading in swf files into a holder swf and want to position each loaded swf underneath eachother with a 10px margin.
This is what I have so far, Its pulling in all the data correctly now just want to position the loaded swfs.
import flash.display.LoaderInfo;
var swfLoader:Loader;
var xml:XML;
[Code]....
I have a parent movieclip that I attach another movieclip to. The parent movieclip is 550px high and the child movieclip is 550px high. When I attach the clip a trace of both movieclips shows them as equal, but the child movieclip is much smaller. How can I make the child fill the entire parent?
View 1 RepliesI am about to design my first Flash website which uses pages of different heights. I want the entire window to be Flash. There will be a background pattern, and the website design will be centered horizontally, with just the height changing depending on which page I'm on. Some pages will require scrolling and other pages will not. If possible, I'd like to use the browsers built-in scroll bar. A few months ago, I would have thought this was impossible to do in Flash, but I actually have seen a website which does exactly this. It's a shame I can't remember the URL. Any suggestions on how I might go about achieving this task? The only way I can imagine is to split up all the pages on separate URL's, but then I won't be able to do smooth transitions between pages.
View 1 RepliesI am about to design my first Flash website which uses pages of different heights. I want the entire window to be Flash. There will be a background pattern, and the website design will be centered horizontally, with just the height changing depending on which page I'm on. Some pages will require scrolling and other pages will not. If possible, I'd like to use the browsers built-in scroll bar. A few months ago, I would have thought this was impossible to do in Flash, but I actually have seen a website which does exactly this. It's a shame I can't remember the URL. Any suggestions on how I might go about achieving this task? The only way I can imagine is to split up all the pages on separate URL's, but then I won't be able to do smooth transitions between pages.
View 3 RepliesI've been battling with this for a while now, I'm loading in swf files into a holder swf and want to position each loaded swf underneath eachother with a 10px margin.This is what I have so far, Its pulling in all the data correctly now just want to position the loaded swfs.
ActionScript Code:
import flash.display.LoaderInfo;
var swfLoader:Loader;
[code]......
I have a simple width and height I am pulling from an xml file, when I trace it out, it shows correctly, but when I tween the width and height it doesn't quite stop at the correct widths and heights. The width and heights from the xml are 800 and 600.
Code:
new Tween(c, "_width",btnEase, c._width,w, 1, true);
new Tween(c, "_height",btnEase, c._height,h, 1, true);
When the tweens stop, the widths and heights are off by anywhere from 5 - 10 pixels.