Timeline And Pulling Content From Array
Hi,
I'm creating a timeline (see attached image below) from 1996 - 2006 with mile stones through the companies highlights in that year.
Some years have one article in them while others have 2 and some 11.
This timeline needs to be as dynamic as possible so that people can just add content to a text file and it will show up in the timeline.
I have an array with strings like this which sits in the first frame of the root:
PHP Code:
var articleLookup = new Array();
articleLookup["1996"] = "This is James";
articleLookup["1997-1"] = "This was James in 1971";
articleLookup["1997-2"] = "This was James in Jan of 1971";
articleLookup["1997-3"] = "This was James in Feb of 1971";
I have two movie clips; one called timeline_mc with my dates buttons in it
and
Another mc called content_mc with a dynamic textbox called contentText_txt.
In the timeline_mc is another mc called prevNext_mc with two buttons called prev_btn and next_btn
Now I have managed to pull in the content for 1996 when I push the 1996 button but my problem comes with 1997.
It pulls in the variable 1997-1 which is cool but I need to be able to show the content for 1997-2 and 1997-3 when the next_btn is pushed and backwards if I push the prev_btn.
There is another MC in the root called highlights_mc with a text box called highlightYear_txt. I am using this to determine what year has been clicked in an if statement (this is the route I think I should be following?). This IF statement sits in a loop created by the two frames in prevNext_mc.
Here is my code on the first frame of prevNext_mc:
PHP Code:
trace(_root.highlights_mc.highlightYear_txt.text);
if (_root.highlights_mc.highlightYear_txt.text == "1998") {
_root.articleLookup["1998-1"];
_root.articleLookup["1998-2"];
_root.articleLookup["1998-3"];
this.content_mc.prevNext_mc.next_btn = function() {
_root.content_mc.contentText_txt.text = _root.articleLookup["1998-2"];
};
}
There must be a more generic way of doing this?
Thanks in advance...
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 10-19-2006, 04:26 PM
View Complete Forum Thread with Replies
Sponsored Links:
Pulling Content From Input TextField Into XML
Hi,
I've managed to create a small CMS for a website of mine. However I'm experincing a slight problem. Whenever I edit the content a second time, the line spaces are deleted.
These
Line
Spaces
= TheseLineSpaces, next time I save the content.
I'm not using <br> for new line spaces, since it's the idea that a few non-coding people should be able to use the schoolsystem I've created.
Thanks for the help
[edit] A few errors [/edit]
View Replies !
View Related
Problems Pulling Html Content From TXT File To A Flash Text Box
Okay, I am pulling variables in to Flash from a text file and displaying them in a dynamic text box. Everything looks great and works fine, except that when I add links to articles like . . .
<a href="http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=6912485">2/4 . . Ahead of the Curve - A design competition for students.</a><br>
The “&” in the link terminates the variable. Is there a way to fix this? Many links seem to have one. In fact 8 of the 12 links I am working with have one.
Any Ideas?
Thanks,
Steely
View Replies !
View Related
Pulling From One Array, Inserting Into Another
I have a loop that sets up a number of arrays:
Code:
//for however many main menu items there are...
for (i=0; i<this.numberItems; i++){
//create empty subMenu arrays
set ("subMenu" + i, new Array);
}
I also have another array called subMenus.
what i want to do is pull an element from the subMenu array and put it into subMenu1.
I cannot for the life of me figure out how to do this.
View Replies !
View Related
Pulling Positions Out Of An Array
Hi I have an array with some postions in it.
for example mypositions:Array = [91,78,67,56,42,30];
What I want to do is pull them out of the array and place them and make them move.Like my_mc is at 91,I want it to move to 78,then to 67,then to 56
etc.
I have done this with a switch/case statement,but need to know how to do it with an array.
Thanks if anyone can help.
View Replies !
View Related
Saving To Array And Pulling Out
Need some help. Trying to learn.
I have sections with questions and answers which I can get.
But, I need to save each section into new array and tally all the final scores.
The screen will show the section score of current section that was just completed
and the final score.
I know the code has lots of problems - attached.
For the total scores the dynamic text boxes var's are totalnumcorrect, totalnumIncorrect, totaluserScore.
For the section score the dynamic text boxes var's are numcorrect, totalnumIncorrect, totaluserScore.
The title changes for each section, so I using that with if statement.
Can someone help please.
Thanks
Attach Code
//final scores
var quizTitleNode=quizNode.firstChild;
title=quizTitleNode.firstChild.nodeValue;
//section scores
section[i] = new Array(numCorrect, numIncorrect, userScore);
// total score
if (quizTitleNode.firstChild.nodeValue = "Section 1: The Mountains") {
section[i] = section1;
}
else if
(quizTitleNode.firstChild.nodeValue = "section 2: The Fields") {
section[i] = section2;
}
else if
(quizTitleNode.firstChild.nodeValue = "section 3: The Rivers") {
section[i] = section3;
}
//section scores as nested arrays
sectionsArray = new Array (section1, section2, section3);
function countFinalScore() {
for(var i=0; i = sectionsArray[0].length; i++);
}
View Replies !
View Related
[CS3] Pulling Multiple Images From An Array (XML)
Actionscript 2
I have a fla set up to pull image paths from an XML and store them in an array. I have managed to get images from the array to display one at a time, but what I want to do is to pull all of the images in the array into a movie clip and line them up horizontally. I hit a wall where I don't know why my code doesn't work. Any help on my code, or an alternate solution would be great. Here's the code
Code:
//SETS UP THE LOOP AND LOOPS THROUGH THE ARRAY
for (var i = 0; i<nodeLength; i++) {
//LOADS EACH IMAGE INTO THE MOVIECLIP COVER_MC, WITH A UNIQUE INSTANCE NAME
_mp3Player.cover_mc.loadMovie(imageArray[i], "myImage"+i);
//POSITIONS EACH MOVIECLIP NEXT TO THE LAST
eval(_mp3Player.cover_mc["myImage"+i])._x = eval(_mp3Player.cover_mc["myImage"+(i-1)])._x+eval(_mp3Player.cover_mc["myImage"+i])._width;
}
I'm a little unclear about how brackets and eval work, and if I need them together. When I load the clips, only the last image in the array appears. That makes me think that they aren't getting unique name, and one image is just over writing the next.
Thanks in advance
View Replies !
View Related
Pulling My Hair Out Copying An Array
I've been working on this problem all week and its driving me crazy. I have yet to find any way of making a copy of a multidimensional array that doesn't reference back to the original data. If you modify the original data the copied version changes as well, i've tried using the apply() method, i've used slice, splice, and about 4 other possible solutions from proto.layer51.com and NONE of them work.
Because the movies and data are dynamic the only way i can access the information is through references
_root.resultTree[obj.group][obj.slide]
i'm trying to make a copy from the obj.group level of the array and place it in the top of the array stack...i've yet to succed. why is this too much to ask? =(
View Replies !
View Related
Pulling Info From And Object Array And Using It To AttachMovies?
I have an object array on the root level of my movie:
logoArray = new Array();
logoArray[0] = {blur:"Bloomfield0",clear:"Bloomfield1"};
logoArray[1] = {blur:"CC0",clear:"CC1"};
and I'm tring to access that info from within another movie and use it to attach a movie into another:
dmy.attachMovie(_root.logoArray[x].blur, "Logo", 1);
When I trace the info I get all the correct info back but it is not attaching the movie.
If I put in an absolute name for the 'linkage' name it works fine.
How can I get it to read the array correctly???
View Replies !
View Related
Problems Pulling Variables From An Array Of Objects
Hey..
I'm created a isometric tile engine and I'm having some problems. I have a multidimensional array of "Tile" objects which is declared in a seperate .as file. Each tile object has a "select" movieclip. For some reason.. I cannot retrieve the movieclip from the tile object from my main program. I get undefined not matter what..
Here is the code from the tile object that declares the "select" variable:
Code:
this.select = attachMovie("Select","Select"+j+k,depth+98);
this.select._x = mapWidth - j * 32 + rowx + pushinx;
this.select._y = sety - 3;
this.select._visible = false;
and here is the retrieve code from the main program which returns undefined:
Code:
tilesArray[0][0].tile.select._visible = true;
what am I doing wrong here?
View Replies !
View Related
[Flash 8] Pulling Multiple Variables From An Array
Hello, first time post at KIRUPA.com. Hope somebody here may be able to point me in the correct direction.
I have an array question as the title explains.
Here's what I would like to accomplish:
search my array for the element (say Names) for tom (name from comboBox component)
and place the other fields(i think there called...age, picture) into either dynamic text fields or load the images into a loader component.
Code:
MyArray.Array= new Array
myArr=[name:"tom", age:"32", picture:"tomspicture.jpg"]
myArr=[name:"steve", age:"50", picture:"stevespicture.jpg"]
myArr=[name:"tom", age:"60", picture:"tomspicture.jpg"]
myArr=[name:"mark", age:"32", picture:"markspicture.jpg"]
name_mc.onRelease = function () {
myName= comboBoxName.value; // collect the value stored in the combo box component and sets it to myName
// here's the problem
// I'd like to have other boxes one for imageLoader to load the image variable
// an ageDynamic_txt box that loads the age variable
// and an nameDynamic_txt box that loads all the names variable
}
Plus is there a way to place the text in the field myArr= [ ... ,description:"I like cake"]
from a .txt file? (ie... I have a file named "desc.txt" with variables (des1)(des2) can I
pull it into the field [..., description: (des(myNuM)] so that myNum loads the specific description for that person?
Code:
desDynamicText_txt.text = myDesLV.des(myNum); // this is kinda the idea.
View Replies !
View Related
How Do I? Content In Movieclip On Main Timeline
I've decided that since my entire movie is going to be so small there is no point in making multiple swf's and load the content from them. I would much rather just put the content into individual movie clips that I place on the main timeline. That would also allow me to have the main timeline be no more then 3 frames long including the preloader. I have seen this done but I am not entierly sure how to do it. More spesifically how do I program my button to load and unload the spesific movieclips that I create?
thx in advance.
View Replies !
View Related
Controlling Timeline With Dynamic Content
Okay, so actionscript is relatively new to me and I need your help.
Basically I want to tell the timeline to either stop or play based upon a numeric value. This value is already properly being displayed within the video as a dynamic text. Now I just want to be able to control how my mask layer moves upward based upon this numerica value.
This is for a fundraiser graph
Here is the latest of what I have tried...
code: function() {
if (_root.sbMoney80 >= 354.00) {
play();
} else {
stop();
}
};
View Replies !
View Related
Can You Load Content Into Frames Further On In The Timeline?
Hi there, hope this is the right section for this - just a quick question, hopefully should be easy. Just wondering if it's actually possible to load content to a specific movie clip/component further on in the main timeline? So for example if I have a button on frame 1, and I have a mediaDisplay component sitting on frame 20, can I load an FLV into this? I've tried to do it, but it doesnt seem to work! If I do something like:
Code:
on (release){
disp.setMedia ("test.flv", "FLV");
}
Now, if the mediaDisplay component (which I've given the instance name of "disp") is on the first frame, which contains the button - it works fine - but if it's sitting on frame 20, and then I go to frame 20 (via another button) it hasn't loaded the content. Any thoughts on how/if this can be achieved?
Cheers!
View Replies !
View Related
How To Design A Timeline, Content Management?
Hello,
I'm trying to ceate a project in flash that will show a timeline of an artists work over a period of about 20 years. I'm trying to get some ideas of how to program this. Would be nice if content and data could be loaded externally, like from XML (which I'm familiar with) but if you know a better way to import data for this purpose let me know. I would like tiny thumbnails or small icons to appear along a horizontal line in the timeline at the corresponding date for each artwork that was made.
But I'm not sure how the best way to do this is?
Anyone done this and have some insight? Can't find anything online because when I search for actionscript and timeline I get a million hits for th "flash" timeline.
Thanks
View Replies !
View Related
Help Building A Seek Slider Bar For Timeline Content
Howdy. I'm been trying to figure out how to build a seek slider bar for content in my flash file...NOT flv video or sound, just the content on the time line. I want to use this primarily in photo/audio slide shows. I want a bar with a sliding button so the viewer can 1) see the progress of the presentation 2)be able to drag back and forth to select move around in the presentation. I'm not looking for anything super complex, just something that is intuitive and easy to use. If anybody has any nice actionscript recipes (I'm using MX 2004, AS 2.0) or knows of any tutorials or anything let me know. Thank you!
here are two examples of what I mean:
http://graphics.stltoday.com/online/musial/
(click on AUDIO SLIDESHOW...the slider in the top right corner)
http://video1.washingtontimes.com/video/2008/riotssilverman/
View Replies !
View Related
Control Dynamic Content From Main Timeline
I'm sure this has been asked many times before...but I can't find anything that will help so I'm gonna ask again..sorry to all of you that have seen this question a million times before...
can you control/access the timeline of a dynamically loaded swf? If so how?
if I use this code:
Code:
loadMovie("a.swf", "contentLoader");
how can I access the timeline of "a.swf" from the main timeline of my flash movie? is it possible?
thanks in advance!
View Replies !
View Related
Scrollpane Content To Link To Different Part Of Main Timeline
please help (and forgive the standard first posting mistakes)
I'm pretty new to Flash MX, (or certainly some areas of it) and I'm trying to create a list of 20 menu items in a scrollpane.
I need to be able to click one these items and jump to a frame in the main timeline, but i'm have trouble with the path. (i think)
I've been using on
(release) {
_parent.gotoAndPlay("framelabel");
}
Which works fine for my movie clip buttons, if i drag the MC onto the stage, but i can't seem to get it to work once i use a scrollpane to attach the movie.
Any ideas what i'm doing wrong????
Rob
View Replies !
View Related
XML Content Into An Array
Has anyone brought XML content into an array? I am reworking a flash movie that is much like a slideshow. It shows a model and a label. I'd like to use an XML file that shows the location of the model and has the label for each model and load that info into an array.
Any ideas?
Thanks
Po
View Replies !
View Related
How To Clear Array Content
I've try to write information from text file into the array
info:
date,phone,text,message
date1,phone1,text1,message1
I've managed to write the info into the array eg array[i]=phone; array[i+=4]=phone.
However, from time to time there will be additional info and when I write the info into the array, it will append every info found in the text into the array. This had caused duplication and the sequence of data is wrong.
Can someone enlightened how to solve this problem such that when the new info is in the text file, i can append just the new data to the end of array.
View Replies !
View Related
Load Array Content
I have an array with buttonnames that I use to sort different buttons depending on their name.
The problem I have is that I have the same array on several places in my movie and find it timewasting when I have to add elements to each array every time.
Is it possible to have the elements in a textfile for example and import them from there?
This is the array I have now.. I want to replace that with something that calls all the "btn_names" from a seperate place
Attach Code
var Buttons:Array = new Array(
btn_one,
btn_two,
btn_three,
etc...
);
View Replies !
View Related
Random Content From Array...
Hi,
I have 12 empty Movie clips on stage. I want to get the content (jpg's or swf's) for these containers from an array. This is all fine, but I would like the contents to be loaded randomly into one of the 12 containers.
The containers load the jpg's, which are preview thumbnails that need to link to the actual larger image plus some text. Loading eveything is OK, but I haven't figured out how to load the content into a random MC...
I attached the fla and images, any help is really appreciated....
Rufus
View Replies !
View Related
Random Content From Array...
Hi,
I have 12 empty Movie clips on stage. I want to get the content (jpg's or swf's) for these containers from an array. This is all fine, but I would like the contents to be loaded randomly into one of the 12 containers.
The containers load the jpg's, which are preview thumbnails that need to link to the actual larger image plus some text. Loading eveything is OK, but I haven't figured out how to load the content into a random MC...
I attached the fla and images, any help is really appreciated....
Rufus
View Replies !
View Related
Array Content Into Text Feild
I'm having trouble getting the content of my array into a text feild
My array is called xpos
My text feild is called content
is was told l could just use
content = xpos.toString();
but it didn't work will l have to set up a for loop to extract each peace one by one.
any advice is appreciated thanks
View Replies !
View Related
Tracing The Content Of A Deep Array?
Hi everybody.
I've constructed an array which gets quite deep (4 levels of it, written with many 'while's) and all the info taken from an xml doc. So in order to gather info from it I'll need to use something like
myArray[0].src.src.src.src
Anyway in order to check for the result of the array (whether it returns any error or null/'undefined values in specific parts, I need to check it. But because it is someting like:
myArray = [{a:v1, c:v2, e:{f:v1, g:v2 h:{i:v1, j:v2}}}, {a:v1, c:v2, e:{f:v1, g:v2 h:{i:v1, j:v2}}}];
I can't see all the content. I tried to use it like 'for(var x in myArray[0])" but I need to use so many of these inside this function and I'll never get the result returned in one line for each main items of this array (2, in above example).
Any idea(s?) appreciated...
View Replies !
View Related
Adding And Removing Content In Array
hi, I'm trying to test if a button, after I've pressed it, is in an Array and if it is, then it removes it self from the Array, otherwise it will add itseelf in the Array.
my code is:
Code:
var myArray = new Array();
mc1.onPress = function() {
for(var i = 0; i<myArray.length; i++) {
if(myArray[i] == mc1) {
myArray.splice(i, 1);
trace("object mc1 has deleted from myArray");
}
if((i >= myArray.length) && (myArray[i] != mc1))
myArray.push(mc1);
i = myArray.length;
trace("object mc1 has imported in myArray");
}
}
And the code doesn't work, so how should I write it?
Thanks.
View Replies !
View Related
Can't Read Array Content Outside Of An Eventlistener
I am loading some images from a webserver into flash.
my script should check wheather the links to the images are valid or not.
all valid images should be in the array called "images". - but there are not.
PHP Code:
package
{
import flash.utils.Timer;
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;
import flash.events.*;
import flash.net.URLRequest;
import flash.display.*;
public class image_gallery2 extends MovieClip
{
public var images:Array = new Array(); //that's where I start with the array
private var i:Number = 0;
private var load_max_images:Number = 15;
private var complete_path:String = "http://pluto1/bm-co/Flash_Photo_Gallery/photos/";
//########################## function get_images_from_server ##########
public function image_gallery2()
{
trace('class is running');
get_images_from_server();
}
//########################## function test_url_Listener################
private function test_url_Listener(event:Event):void
{
if (event.type == Event.COMPLETE) {
images.push(event.target.url); //Push the URL of the image into the array "images"
trace('image found');
} else if (event.type == IOErrorEvent.IO_ERROR) {
trace('no image found');
}
}
//########################## function get_images_from_server ##########
private function get_images_from_server(){
while(i < load_max_images){
var this_image:String = complete_path + 'IMG_' + i + '.jpg';
var url:URLRequest = new URLRequest(this_image);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, test_url_Listener);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, test_url_Listener);
loader.load(url);
i++;
}
trace('all images loaded: ' + images); //this is where I want to trace the images, but the array "images" seems to be empty }
}
}
View Replies !
View Related
Comparing TextField With Array Content
HI,
I'm having some trouble with arrays, especially comparing a keyword which the user writes in to a TextField with a word placed in my Array.
I've been pounding my head against the wall a few days and would appriciate some help.
ActionScript Code:
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import fl.controls.Button;
public class SearchEngine extends MovieClip {
var myArray:Array = new Array();
var myField:TextField = new TextField;
var myField2:TextField = new TextField;
var myField3:TextField = new TextField;
var myField4:TextField = new TextField;
var myButton:Button = new Button;
var myButton2:Button = new Button;
var myButton3:Button = new Button;
var myButton4:Button = new Button;
var myButton5:Button = new Button;
public function SearchEngine() {
myField.type = TextFieldType.INPUT; //add name to array
myField.border = true;
myField.width = 100;
myField.height = 25;
myField.x = 25;
myField.y = 25;
addChild(myField);
myField2.type = TextFieldType.INPUT; //search for specific name in array
myField2.border = true;
myField2.width = 100;
myField2.height = 25;
myField2.x = 250;
myField2.y = 25;
addChild(myField2);
myField3.border = true; //list all names in array
myField3.width = 100;
myField3.height = 150;
//myField3.wordWrap = true;
myField3.x = 25;
myField3.y = 75;
addChild(myField3);
myField4.border = true; //if name is or is not in array it tells you so
myField4.width = 200;
myField4.height = 25;
myField4.x = 250;
myField4.y = 75;
addChild(myField4);
myButton.label = "Search Name";
myButton.width = 80;
myButton.height = 25;
myButton.x = 360;
myButton.y = 25;
addChild(myButton);
myButton2.label = "Add Name";
myButton2.width = 80;
myButton2.height = 25;
myButton2.x = 135;
myButton2.y = 25;
addChild(myButton2);
myButton3.label = "List Names";
myButton3.width = 80;
myButton3.height = 25;
myButton3.x = 135;
myButton3.y = 75;
addChild(myButton3);
myButton4.label = "Sort Names";
myButton4.width = 80;
myButton4.height = 25;
myButton4.x = 135;
myButton4.y = 105;
addChild(myButton4);
myButton5.label = "Erase Names";
myButton5.width = 80;
myButton5.height = 25;
myButton5.x = 135;
myButton5.y = 135;
addChild(myButton5);
myButton.addEventListener(MouseEvent.CLICK, SearchName);
myButton2.addEventListener(MouseEvent.CLICK, AddName);
//myButton3.addEventListener(MouseEvent.CLICK, ListNames);
//myButton4.addEventListener(MouseEvent.CLICK, SortNames);
//myButton5.addEventListener(MouseEvent.CLICK, EraseNames);
}
public function AddName(event:MouseEvent) {
myArray.unshift(myField.text);
if(myField3.text == myField.text){
myField.text = "";
}
myField.text = "";
trace(myArray);
}
public function SearchName(event:MouseEvent) {
var myResult1:String = " was found";
var myResult2:String = " was NOT found";
for (var i:int = 0; i < myArray.length; i++) //loop through array
{
if (myArray[i] == myField2.text) //array variable compared to user input
{
myField4.text = myField2.text + myResult1;
}
if (myField2.text != myArray[i] )
{
myField4.text = myField2.text + myResult2;
}
break;
}
}
}
}
View Replies !
View Related
Showing Array Content In Sequence?
I would like to pick every element of my array and fade it in in sequence when my movie begins.
i know i have to use setInterval and loops, but in my million trials i couldn't figure it out.
here's the code (i know it's missing a lot..),
i would appreciate any suggestion,
thanks!
ActionScript Code:
var pics:Array = [a1, a2, a3, b1, b2, b3, c1, c2, c3];
//
//
function doAppear() {
for (var i = -1; ++i<pics.length; ) {
this._alpha += 1;
}
}
function init() {
for (var img in pics) {
pics[img]._alpha = 0;
pics[img].onEnterFrame = doAppear;
}
var interval = 10000;
var id = setInterval(fadePics, interval);
}
init();
//
View Replies !
View Related
Adding Html To Array Content
I'm trying to put html breaks to this array so that the set of names are rendered downwards instead of side by side:
Code:
var pageContent:Array = ["bob", "larry", "moe", "charlie", "john", "joe", "jesus", "mitch", "sarah", "steph", "susan", "jimmy"];
var txtFmt:TextFormat = new TextFormat();
txtFmt.font = "Helvetica";
txtFmt.bold = true;
txtFmt.size = 18;
var txtFld:TextField= new TextField();
txtFld.autoSize = TextFieldAutoSize.LEFT;
txtFld.multiline= txtFld.wordWrap = true;
txtFld.defaultTextFormat= txtFmt;
for(var i:Number=0; i < 10 ; i++)
{
txtFld.appendText( pageContent[i]);
}
addChild(txtFld);
In php it's just as simple as echoing out html tags in the for loop but I dont get it in AS3. Any help is greatly appreciated!
View Replies !
View Related
Creating An Array And Adding New Content?
I have a site I'm trying to create. I have the book "Flash to the Core" by Joshua Davis, who explains what I need to do, very well...all except this problem. I have set everything up, but I'm not sure how to add more content.
Here is a location where I uploaded the file, its zipped, just the fla and swf.
http://www.rookscommunications.com/flashHelp.zip
I have a movie clip inside a movie clip and when you scroll or click, you are moved to a new section. I have it set up so each new section shows a name generated by the code, but I need to actually place new content in each section. I've tried a few things, like creating a new "section" movie, but nothing works. How do I accomplish this? It should be doable.
His website which has each chapter file downloadable is:
flashtothecore.praystation.com (it's ch 21)
Also, he shows and example which is what I'd like to do here:
http://classic.motown.com/timeline/
Thanks for any help.
Stacy
View Replies !
View Related
Trying To Load A Clip That Contains An Array, And The Content Vanishes
I have a main movie (main.swf) that when you hit a button, it loads another swf (content.swf) into a blank clip on the stage. The movie that is getting loaded (content.swf) contains an array that in turn is loading other external mc's (subcontent_0, subcontent_1, etc), that are arranged together side by side, and when you click a button the content moves from left to right. When I test the content.swf it works fine, the subcontent is loading, and the array works fine.
Now when I test the main.swf, the content.swf is getting loaded, but within the content.swf, the subcontent mc's are not loading.
Can anyone shed some light on this? I don't understand why this wouldnt work. All I can think of is, (obviously), the content.swf cannot somehow find the subcontent mcs, although everything is in the same folder, and it works fine when I test it independently of the main.swf.
???
View Replies !
View Related
[F8] Generate Buttons Based On Array Content
Hi, I am trying to create a scrollable list of links.
-I have a scroller with deceleration I'd like to utilize. It updates it's length based on the content of a movieclip. This is taken care of.
-The links that show in this scroller depend on the content of my array. For example, an element in my array holds ["green","shirt","www.flashkit.com"] and I want to pull this text into a button. The amount of buttons showing depends on how many elements are present in the array. Each button generated will pull it's text and URL from the array. I have my arrays taken care of. I just need help generating the buttons and pulling the info from the array. Thanks in advance! Very much appreciated!
View Replies !
View Related
Array Content 'undefined' In Simulate Download
One last time and then I abandon this idea of importing XML files forever
I have attached a sample .fla file plus folders with the other files in the Variables not found only on "simulate download" post if you want to try running it.
There are 42 XML text files and 42 buttons on stage. In 'Test Movie' all 42 external XML files load perfectly every time - switch to 'Simulate Download' and keep clicking. It won't take long to "break it" and an 'undefined' will appear. But if you keep clicking, the same text will be defined on the next time around - so this isn't simply a case of the array not being created properly.
This is the frame in the preloader that creates the array that holds the XML files - it loops until they are all loaded - the counter is set and incremented in the other preloader frames:
Code:
function loadXML(loaded) {
if (loaded) {
//loops back to load all text
var xnRootNode:XMLNode = this;
myText[nCounter] = xnRootNode;
gotoAndPlay(next);
}
}
var xmlData:XML = new XML();
xmlData.ignoreWhite = true;
xmlData.load(allText[nCounter], allPics[nCounter] );
xmlData.onLoad = loadXML;
This is the line of code that gets the XML content when a button is clicked - it's in a mc ('stageContent_mc') to make it available globally, therefore '_root.' is in the line below. This is definitely where 'undefined' happens - in the code that grabs the XML content from the array, right before it's dynamically put into the text field.
Code:
textForStage = _root.myText[textNum];
'textNum' will never fail to show the number clicked when 'undefined' appears - but 'textForStage' which is the actual text in the array will show 'undefined' in the output window.
Any ideas on how to solve this (after a year) would be GREATLY appreciated.
Thanks
Charles
P.S. Any idea why the gifs are actually not loading INTO the .fla file? There is a definite lag time when using real gifs with larger file size.)
View Replies !
View Related
Array Content 'undefined' In Simulate Download
One last time and then I abandon this idea of importing XML files forever
I have attached a sample .fla file plus folders with the other files if you want to try running it in the Variables not found only on "simulate download" post.
There are 42 XML text files and 42 buttons on stage. In 'Test Movie' all 42 external XML files load perfectly every time - switch to 'Simulate Download' and keep clicking. It won't take long to "break it" and an 'undefined' will appear. But if you keep clicking, the same text will be defined on the next time around - so this isn't simply a case of the array not being created properly.
This is the frame in the preloader that creates the array that holds the XML files - it loops until they are all loaded - the counter is set and incremented in the other preloader frames:
Code:
function loadXML(loaded) {
if (loaded) {
//loops back to load all text
var xnRootNode:XMLNode = this;
myText[nCounter] = xnRootNode;
gotoAndPlay(next);
}
}
var xmlData:XML = new XML();
xmlData.ignoreWhite = true;
xmlData.load(allText[nCounter], allPics[nCounter] );
xmlData.onLoad = loadXML;
This is the line of code that gets the XML content when a button is clicked - it's in a mc ('stageContent_mc') to make it available globally, therefore '_root.' is in the line below. This is definitely where 'undefined' happens - in the code that grabs the XML content from the array, right before it's dynamically put into the text field.
Code:
textForStage = _root.myText[textNum];
'textNum' will never fail to show the number clicked when 'undefined' appears - but 'textForStage' which is the actual text in the array will show 'undefined' in the output window.
Any ideas on how to solve this (after a year) would be GREATLY appreciated.
Thanks
Charles
P.S. Any idea why the gifs are actually not loading INTO the .fla file? There is a definite lag time when using real gifs with larger file size.)
View Replies !
View Related
Randomizing Existing Content In Array(), Ooohhh
Ok, so here's a good one for you. This ones got me stumped a little. How would you randomize the contents of an array? I have this:
A1 = Array(content1, content2, content3, etc..)
So when the contents are read it won't be in order but none of them will be called twice before each value is called at least once. That's where my problem is. Using the least amount of code to cycle through the values and not having to check and recheck each value. Thanks for any help.
Stumpled in Tampa,
Bo
PS. If you would like to get paid for creating a multiplayer game of rook with payment gateway let me know.
View Replies !
View Related
Build Timeline XML Array Problem
Using XML to build an array called StartDates, which comes in the form of MM/DD/YYYY. Spits out something like "09/01/1890, 08/22/1922, 12/12/1930".
Need to get the decades from those dates and any in between. In the example above, it would be 5 decades (1890s, 1900s, 1910s, 1920s, 1930s).
here's my terrible attempt:
Code:
var StartYears:String = StartDates[i].substr(6,4);
var numYear:Number = number(StartYears);
var Decades:Number = numYear.length..??
??
Any ideas? TIA
View Replies !
View Related
Array To Control MCs On The Root Timeline
HI - - - a continuing saga
I have a main timeline thats about 900 frames long. During the course of this 900 frames I bring in short MCs (subA, subB, subC, etc) on their own layer which play their duration - (a 90 frame sub MC gets 90 frames on the main timeline).
Using a mc I made into a play/pause btn, I can pause and resume play of the main timeline by targeting “_root”.
I can also use the same button to pause/play the sub_mcs IF I list each one at the pause and play commands. I thought an array would help me avoid that code repetition but it doesn't work.
Can someone look at my code and let me know what's missing and/or what I did wrong?
TIA
JL
Attach Code
var allSubMCs:Array = new Array("sub1_mc", "sub2_mc", "sub3_mc");
playPause_btn.onRollOver = function() {
if(this._currentframe == 1) {
this.gotoAndStop("pauseOver");
}
else {
this.gotoAndStop("playOver");
}
}
playPause_btn.onRollOut = function() {
if(this._currentframe == 10) {
this.gotoAndStop("pause");
}
else {
this.gotoAndStop("play");
}
}
playPause_btn.onRelease = function() {
if(this._currentframe == 10) {
this.gotoAndStop("playOver");
_root.sub1_mc.stop(); // naming each sub mc does
//_root.allSubMCs.stop(); // the array doesn't work
_root.stop();
}
else {
this.gotoAndStop("pauseOver");
//_root.allSubMCs.play(); // the array doesn't work
_root.sub1_mc.play(); // naming each sub mc does
_root.play();
}
}
//------END PlayPause TOGGLE--------
View Replies !
View Related
How To Display The Unique Random Content From The Array By Using DistinctShuffle()...
How to Display the Unique Random content from the Array by using distinctShuffle()...
There's gotta be many ways of doing it, but I do it this way just in case somebody wants to know how to do it...
Copy and paste this script to the new Flash movie and check out the Output Panel to see what's going on...
PHP Code:
// Array.prototype.distinctShuffle
// author: splict
Array.prototype.distinctShuffle = function()
{
res_arr = [];
arr_lngth = this.length;
for (var i = 0; i < arr_lngth; i++)
{
var curNum = random(i + 1);
res_arr.splice(curNum, 0, this[i]);
}
return res_arr;
};
content_arr = new Array({name:"Name 0", content:"Content 0"},
{name:"Name 1", content:"Content 1"},
{name:"Name 2", content:"Content 2"},
{name:"Name 3", content:"Content 3"},
{name:"Name 4", content:"Content 4"},
{name:"Name 5", content:"Content 5"},
{name:"Name 6", content:"Content 6"},
{name:"Name 7", content:"Content 7"},
{name:"Name 8", content:"Content 8"},
{name:"Name 9", content:"Content 9"});
tmp_arr = content_arr.distinctShuffle();
displayContent();
function displayContent()
{
if (tmp_arr.length > 0)
{
tmp = tmp_arr.shift();
trace(tmp.name + " : " + tmp.content + " :: tmp_arr.length = " + tmp_arr.length);
}
else
{
trace("-----
Shuffling the array...
-----");
tmp_arr = content_arr.distinctShuffle();
}
}
contentInterval = setInterval(displayContent, 1000);
View Replies !
View Related
[CS3] AS2.0 - Use An Array To Advance Timeline Through Frame Labels
Hey all,
Thanks in advance for any help you might have! I am working on a project and I originally had my forward back buttons just advancing 24 frames, but the client has since decided that they want to move to certain spots in the the animations. There are about 15 animations total with 4-18 frame labels.
I want the forward button to move to the next frame label and the back button to go to the previous frame label. I have heard suggestions of using an array, but having never written one I don't know where to start. Any help would be appreciated. I am using CS3 with AS 2.0.
Thanks!
View Replies !
View Related
Array And Movie Loader Affecting Timeline.
I have a script loading an SWF into an movie clip. This script is on the timeline of a movieclip which is then on the main timeline. This script is causing my movie to jump around the main timeline seemingly randomly to different frames.
The tutorial I found parts of it in had it on the main timeline so I wondered if the paths could be causing the problem.
Thanks any help would be appreciated.
Attach Code
stars = new Array("Star0.swf", "Star1.swf", "Star2.swf", "Star3.swf");
for(i=0;i<stars.length;i++){
_root.attachMovie(stars[i],stars[i]+"_2",i);
starTarget._y = Math.random()*189;
starTarget._x = Math.random()*707;
starTarget._alpha = Math.random()*100;
starTarget._rotation = Math.random()*360;
d = stars.length;
k = Math.floor(Math.random()*d);
loadMovie(stars[k],starTarget);
}
View Replies !
View Related
HELP Pulling Url From XML
Hello,
First of all in the attachment is the flash that connects to the XML below.
In the flash AS i have setup the XML connection etc which works but when i put an onRelease function for the image to retrieve an url from the XML, it fails to do so.
Is it at all possible that someone can help me?
Thank you,
Carl
XML----------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
<image>http://www.carltaylor.eu/untitled.JPG</image>
<link>http://www.carltaylor.eu</link>
</pic>
<pic>
<image>http://www.carltaylor.eu/untitled2.JPG</image>
<link>http://www.carltaylor.eu</link>
</pic>
</images>
View Replies !
View Related
HELP Pulling Url From XML
Hello,
First of all in the attachment is the flash that connects to the XML below.
In the flash AS i have setup the XML connection etc which works but when i put an onRelease function for the image to retrieve an url from the XML, it fails to do so.
Is it at all possible that someone can help me?
Thank you,
Carl
XML----------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
<image>http://www.carltaylor.eu/untitled.JPG</image>
<link>http://www.carltaylor.eu</link>
</pic>
<pic>
<image>http://www.carltaylor.eu/untitled2.JPG</image>
<link>http://www.carltaylor.eu</link>
</pic>
</images>
View Replies !
View Related
HELP Pulling Url From XML
Hello,
First of all in the attachment is the flash that connects to the XML below.
In the flash AS i have setup the XML connection etc which works but when i put an onRelease function for the image to retrieve an url from the XML, it fails to do so.
Is it at all possible that someone can help me?
Thank you,
Carl
XML----------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
<image>http://www.carltaylor.eu/untitled.JPG</image>
<link>http://www.carltaylor.eu</link>
</pic>
<pic>
<image>http://www.carltaylor.eu/untitled2.JPG</image>
<link>http://www.carltaylor.eu</link>
</pic>
</images>
View Replies !
View Related
Pulling Rgb Hex
HI,
I am using the tutorial on:
http://www.kirupa.com/developer/actionscript/color.htm and I am wondering if it is possible to put a dynamic text box on that page, and when you initally load the page, it will give the hex value, and when you rollover the "new color" that dynamic text box will change real time.
thanks
fyl
View Replies !
View Related
Changing An Array Name W/o Changing The Content
I have a generated array called foo, now what I would like to do is change the name of the array, without changing the content of the array itself. I am trying to make the name of the array, so it can be made part of a count. Like this.
from foo = ["Room,150,1"]; to T1=["Room,150,1"];
Thank you in advance for any help
Killin
View Replies !
View Related
Pulling Variables From A URL:
Is this possible? Example:
someone goes to
http://www.server.com/flashmovie.html?variable=value
The .swf examines that URL, and parses it (is parse the right word?) such that the variable and value are extracted and used in the movie.
Maybe this is what generator is for, but I'm just looking for a way to get dynamic text into a movie..
View Replies !
View Related
|