ActionScript 2.0 :: Dynamically-XML-Loaded Text With Buttons Not Loading?
Mar 24, 2010
This question relates to the gallery that I'm working on; basically, I am now trying to add text comments which change according to which button you press to the images. I know how to make this work by applying actionscript to each individual button, but I would like to put all of the actionscript on one layer, meaning that I would have to use the 'button.onRelease = function ()' operation instead of the 'on (release) { function" operation.The code is a variation of Kirupa's code for the tutorial on loading information from an XML, and the xml is his completely. Here it is so far:
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
[code].....
View 3 Replies
Similar Posts:
Jan 12, 2005
I'm trying to apply CSS to text that is loaded from an external text file. Now, it works fine when I play it in the movie file "current.swf". Here is the code as it is-
Code:
var format = new TextField.StyleSheet();
var path = "jbcss.css";
format.load(path);
format.onLoad = function(success) {
if (success) {
[Code]...
View 9 Replies
Mar 23, 2004
I am having 2 problems with the following code...
[AS]
picNamesA = ["pic1","pic2","pic3","pic4","pic5","pic6"];
picNamesB = ["pic7","pic8","pic9","pic10","pic11","pic12"];
[code]....
Ok First problem the pics load but the second FOR loop the buttons don't position themselves correctly. Second problem was in the getURL() It doesnt seem to read the variable picNamesA[i], I did a trace as you can see and it outputs "undefined".
View 11 Replies
Jun 17, 2009
I'm currently having a little trouble in a project where I have the following occuring:
Code:
preloader.swf --- loads 2x --- homepage.swf --- can load --- products.swf
When the products.swf is loaded, the starting animation occurs as expected and is displayed on the screen without an issue. However, I can't interact with any of the buttons contained in the products.swf. The products page works like an overlay over the top, and the homepage.swf contains an background which can be clicked on to close the overlay. If you click on the products.swf it reacts as if the background was clicked, which it shouldnt as the products.swf is located on top of the background.
I have already checked the obvious parts, and am ensuring that products.swf is located at numChildren-1, so nothing is getting in the way. The catch is that everything was working fine when the code was internal to the fla, and now as soon as I moved the code to an external .as file nothing works. I am using the same way of loading the products.swf as I am loading the homepage.swf, which looks like:
Code:
var productsLoader:Loader = new Loader();
productsLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onProductsCompleteHandler);
productsLoader.load(new URLRequest("products.swf"));
onProductsCompleteHandler:
[Code] .....
View 1 Replies
Mar 8, 2004
There is a button in my library say mybutton_btn.I want to dynamically create an instance of it add it on stage something like insName=new myButton_btn();. How can this be achived?
View 7 Replies
Feb 21, 2011
how to include some css style sheet with my dynamically loaded xml buttons. Here the code for css:
ActionScript Code:
a:link {
color:#FF0099;
font-family:"Arial";
[code]....
View 4 Replies
Aug 9, 2004
what it has to do is to generate "j" buttons (j being the number of registrations from my database) and arrange them in rows of 5 or 6. unfortunately the buttons are generated but are not arranged properly. i have 9 registrations in the database so there are 9 buttons... the first 8 are next to each other and the last one is somewhere to the right.further on, at the release of a button it should create the lwLogo movieclip and load there a certain pic (the path being taken from my database). then the lwLogo mc should be centered on the screen... as this doesn't happen in the _root the center of the screen would be -442 in this movie clip so normally to center the image i should place lwLogo at -442-(lwLogo._width/2) but this doesn't work. the photos are loaded but not in the center.[code]
View 3 Replies
Feb 27, 2006
I am using the tutorial about dynamically loading images, that then fade when a button is pressed and change to the next image, however I want to load the images and have them fade in and out without pressing anything i.e. an mc that rotates the images, fading them in and out.
The script I have been using is this:
[Code].....
View 6 Replies
Aug 4, 2010
i have a swf file which is a framework file done in puremvc and i m loading multiple swf files. one of the swf file loaded into the main swf file loads multiple sub swf files in it. works fine but in the loaded swf file which loads multiple swf files in it.. button dosent work at all. i m not able to click on any button. i m jst making a tree structure so can be easily understood..
container swf -> external swf -> miniSwf file and in miniSwf dynamic button are not clickable but they have all the Mouse eventListeners.
View 1 Replies
Aug 17, 2009
- Flash CS4 Actionscript 2.0 internal training project- Main movie is a single frame project, containing just the interface. This includes a menu listing 80+ individual "chapters" for the training series.- Each "chapter" is its own project/swf. Once the main interface loads, it should begin to play the chapters sequentially without the user selecting anything from the menu. When one chapter finishes, the next should load. If the user DOES select a chapter in the menu, it should load that SWF, and continue auto-playing from that selection forward.- Each chapter has a built-in play/rewind/ff bar, various movie clips with animations, dialogue audio track and a fairly lengthy embedded FLV movie, and therefore a preloader before each chapter is mandatory.What I have so far works, but it's embarrassingly crafted:- First frame of main movie (let's call this main.fla) contains the following code (most of this code was taken from an online tutorial):
var slideName = "modules/intro.swf";
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(this);
[code].....
View 1 Replies
Nov 6, 2006
I'm working on a portfolio site that I'm pretty much done with, but I'm having trouble with the loading order of the thumbnails on the site. The work in the portfolio is grouped into clients, and within each client, there are thumbnails that display the selected work. This will probably make more sense if you can see what I'm talking about: [URL]. (Only the first two clients are enabled at the moment). Specifically, when the page is first loaded (from a web server) the thumbnails show up in the wrong order. When the page is refreshed, the thumbnails are displayed in the correct order.
The thumbnails always display in the correct order when being viewed locally, or in the Flash Test Movie environment. I'm pulling in the data from an xml file into an array, and iterating through the elements of the array with a for...next loop, I'm loading the thumbnail images with a MovieClipLoader instance. Using the onLoadInit event, I then set the horizontal position of each thumbnail clip. As much as I'm looking for reasons why the order could be switching. I suspect it has to do with which thumbnail image finishes loading first - in which case, how to force the images to load in the correct order. Maybe I should use if...then and load the next thumbnail only when onLoadComplete fires?
View 2 Replies
Mar 26, 2010
I have run into a very strange problem with Flash and Flex. It appears that under certain circumstances, movie clips from a SWF loaded at runtime (using Loader) cannot be instantiated if another SWF has been loaded in the mean time. Here is the complete code for a program that reproduces the error. It is compiled using mxmlc, via Ensemble Tofino:
[Code]...
View 4 Replies
Jun 14, 2004
I need help dynamically loading text from a server into a dynamic text box in my movie. If i use the loadVariables it works, with the Html rendering.. if i use it with loadVars it works but now the html doesn't render. What i want is to load some text from my server into the text box and have the html to render. Also, is there a way to display the progress as the text loads, for people with slower connections?
View 1 Replies
Jun 14, 2004
I need help dynamically loading text from a server into a dynamic text box in my movie. If i use the loadVariables it works, with the Html rendering.. if i use it with loadVars it works but now the html doesn't render. What i want is to load some text from my server into the text box and have the html to render. Also, is there a way to display the progress as the text loads, for people with slower connections?
View 1 Replies
Oct 1, 2011
So this is my code so far. What I am trying to do is load the attribute of name into separate MC's that are clickable to then once clicked have the MC "txtBox" load what is in the attribute "link".As it stands now the name of the buttons is loading perfectly, but the trace is bringing back an undefined value
Code:
importXML = new XML();
importXML.ignoreWhite = true;
importXML.onLoad = function(success)
[code]....
View 9 Replies
Jun 7, 2011
I'm externally loading text from a .txt file. I need to format that file using CSS. I've got the CSS file set up and everything. I've tried every tutorial I can find to try and load the CSS, but nothing is working.Here is the script for loading the text:
var textLoader:URLLoader = new URLLoader();var textReq:URLRequest = new URLRequest("content_files/commissions.txt");
textLoader.load(textReq);textLoader.addEventListener(Event.COMPLETE, textLoadComplete);
[code].....
View 2 Replies
Jul 21, 2003
except with an external txt file for the animation to read from. ... is this possible to do with flash, i have read a cuple of tutes, but haven't been able to get it working..Here is what i have so far, I created a dynamic text box and can read in the text using
loadText = new loadVars();
loadText.load("hello1.txt");
loadText.onLoad = function() {
[code].....
View 6 Replies
Feb 18, 2004
Im currently doing a quiz, which, after the user completes all the questions, displays the users score and depending on that score, a certain message ie
if (score<=2) {
Score_Msg.text =" That was poor!":
} else if (score<=5) {
Score_Msg.text = "You know a bit but not much";
}
In the text, i want to include a hyperlink. Is there anyway of making certain parts of dynamically loaded txt into a hyperlink?
View 2 Replies
Mar 21, 2004
After completing the dynamic text loading tutorial, I'm attempting to format the text after it's loaded with the following[code]...
View 3 Replies
Feb 10, 2003
I followed the tutorial for Scrolling Dynamically Loaded Text & its works well. The problem I am experiencing I have a limited about of space in my movie for the text box. The text file has all the data that I need to display but for some reason I only see a portion of the information & I can't seem to figure out my mistake.
View 9 Replies
Apr 8, 2003
I keep on running into weird formatting problems when working with external text files loaded in dynamic text boxes. the latest is with the attached txt file. It stops displaying the text right before the first href HTML tag...
View 12 Replies
May 7, 2003
Is it possible to call different data from a same text file? In the tutorial about the dynamically loaded text, the example was "kirupatext=" and the text was loaded from after that in the txt file. Is it possible to make it stop loading after a certain point?
For example,
" kirupatext=
Hello There!
I am an example of text that has been loaded from a separate location on kirupa's server. Best of all, notice that you can scroll the contents of the text up and down by clicking on the arrows. This is a nice, useful feature that you can use on your site."
How can I make it load only up to "Best of all"? Is it possible to break up the text into 2 parts so that they are loaded by different text boxes? i tried adding another marker like "kirupatext2=" at another point, but it just gets loaded along with the first "kirupatext=".
View 8 Replies
Jul 20, 2006
I found the following tutorials helpful, but now I want to combine them, but I don't know how.[URL]
code for the scroller
loadText = new loadVars();
loadText.load("answers.txt");
//creating the loadVarsText function
[code]....
View 3 Replies
May 29, 2007
Another problem for me with the dynamic scroller found on the Kirupa site: [URL] I can't figure out how to create URL links in the text. I tried selecting "render text as HTML" and added this to the .txt file: < a h ref=" mylink" > mylinkhere < / a> (without the spaces) but it just showed up 'as it'.
View 1 Replies
Jan 29, 2008
I'm fairly new to action script so this might be me being simple but: I followed the Scrolling Dynamically Loaded Text tutorial and added it to my flash movie and although it works perfectly in the tests and once published once it loads in the browser all I get is the word undefined at the top of the text box. I've searched all over for a solution but as I said my understanding of action script is fairly limited.
[Code]...
View 6 Replies
Jul 21, 2003
except with an external txt file for the animation to read from. ... is this possible to do with flash, i have read a cuple of tutes, but haven't been able to get it working...
Here is what i have so far, I created a dynamic text box and can read in the text using
[Code]...
Txt being the name of the instance of my text box....but see when i try to make this into a symbol or clip, and animate it, i dont see the text anymore
View 6 Replies
Aug 4, 2004
Does anyone know if it's possible to make a url link within text dynamically loaded from a .txt file into a blank dynamic text box?
View 1 Replies
Mar 21, 2004
After completing the dynamic text loading tutorial, I'm attempting to format the text after it's loaded with the following.
var loadText = new LoadVars();
loadText.load("data.txt");
loadText.onLoad = function() {
[Code].....
View 3 Replies
Jan 17, 2004
I have a dynamic text box (myText.text and services.text), that load different texts from different buttons. Below is the code for one of the buttons. Where it says... "here" I want to create a link that opens up a centred html file. Is there any coding that I can use?
wed1_btn.onRelease=function() {
myText.text = "Wedding Consultation... ? ";
services.text = "Our consultation.. blah blah. Click here for fees ";
}
View 2 Replies
Nov 29, 2009
I have a class that loads data from a text file and puts it into an array called tdv.importedTxtArray (public var).In a separate class i have written [code]The infoArray does not then contain the imported text however because tdv.importedTxtArray is not given its popper contents until about 1/2 a second after the tdvLoader class executes (i.e: when Event.COMPLETE is run and the array is populated with strings from the external text file). Subsequently in the code above infoArray is set to a blank array.How can i get the code in my separate class to ''wait' until tdv.importedTxtArray is properly populated before accessing it.
View 2 Replies