Add Hyperlinks To Db-derived Text
Hello,
I've gotten a lot of good tips from kirupa so here goes:
I am working on an mp3 player that pulls song titles from a database, using php and MXPRO2004.
I am able to display the song titles in a scrolling pane that contains a duplicating text box.
I would like to learn how to make a link for each song that would load an mp3 into Flash and play it, depending on the song title that is clicked.
The songs would be named 1.mp3, 2.mp3 etc, and would be kept in a specific folder. This folder would be based upon the album's catalog number ( /audio/mp3/catalog_id/1.mp3 ). The catalog_id would be loaded from the page url and inserted into the link. The catalog_id would be a number, like 6528.
The mp3 file names (1.mp3 etc) would then append themselves to the link for the corresponding title.
Can someone point out a thread that talks about this or give me a few hints? Thanks alot!
The code that I have so far, which loads the titles::
myLoad = new LoadVars(); myLoad.path = this; //this is the group's name:: myLoad.musical_group_id = _root.musical_group_id; //this is the album name:: myLoad.catalog_id = _root.catalog_id;
myLoad.onLoad = function(success) { if (success) { this.path.pane_sp.boundingBox_mc._visible = false; this.path.pane_sp.setScrollContent("emptyClip"); var mc = this.path.pane_sp.getScrollContent(); for (var i = 0; i < Number(this.totals); i++) { var item = new Object(); item.title = this["title" + i]; item._y = i * 25; mc.attachMovie("singleRecord", "record" + i, i, item); } this.path.pane_sp.refreshPane(); } else { trace("PHP PAGE NOT FOUND"); } }; myLoad.SendAndLoad("flash_songs.php", myLoad, "GET");
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 12-30-2003, 03:51 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Add Hyperlinks To Db-derived Text
Hello,
I've gotten a lot of good tips from kirupa so here goes:
I am working on an mp3 player that pulls song titles from a database, using php and MXPRO2004.
I am able to display the song titles in a scrolling pane that contains a duplicating text box.
I would like to learn how to make a link for each song that would load an mp3 into Flash and play it, depending on the song title that is clicked.
The songs would be named 1.mp3, 2.mp3 etc, and would be kept in a specific folder. This folder would be based upon the album's catalog number ( /audio/mp3/catalog_id/1.mp3 ). The catalog_id would be loaded from the page url and inserted into the link. The catalog_id would be a number, like 6528.
The mp3 file names (1.mp3 etc) would then append themselves to the link for the corresponding title.
Can someone point out a thread that talks about this or give me a few hints? Thanks alot!
The code that I have so far, which loads the titles::
myLoad = new LoadVars();
myLoad.path = this;
//this is the group's name::
myLoad.musical_group_id = _root.musical_group_id;
//this is the album name::
myLoad.catalog_id = _root.catalog_id;
myLoad.onLoad = function(success)
{
if (success) {
this.path.pane_sp.boundingBox_mc._visible = false;
this.path.pane_sp.setScrollContent("emptyClip");
var mc = this.path.pane_sp.getScrollContent();
for (var i = 0; i < Number(this.totals); i++) {
var item = new Object();
item.title = this["title" + i];
item._y = i * 25;
mc.attachMovie("singleRecord", "record" + i, i, item);
}
this.path.pane_sp.refreshPane();
} else {
trace("PHP PAGE NOT FOUND");
}
};
myLoad.SendAndLoad("flash_songs.php", myLoad, "GET");
Loading Text Files With Hyperlinks Into Dynamic Text Field
I am using Flash 8 and loading external text files in dynamic text fields on my webage. These texts contain html links (<a href="page.html" target="_blank">Click Here</a> and I have "render as HTML" on and "selectable" off in my dynamic text field. Also, I am loading a CSS file. Not only do I not have a hand cursor, but I do not even have any of the text from that piece of html code down. What is going on with this? Please respond asap, as I have been struggling with this for a day now. Here is the Actionscript for loading the CSS:
var flash_css = new TextField.StyleSheet();
flash_css.load("styles.css");
flash_css.onLoad = function(success:Boolean) {
if (success) {
zloc_txt.styleSheet = flash_css;
} else {
trace("Error loading CSS file.");
}
};
var zloc_lv:LoadVars = new LoadVars();
zloc_lv.load("zloc.txt");
zloc_lv.onLoad = function(success:Boolean) {
if (success) {
zloc_txt.text = this.content;
} else {
trace("unable to load text file.");
}
};
zloc_txt.html = true;
zloc_txt.editable = false;
_global.styles.TextArea.setStyle("backgroundColor" , "transparent");
_global.styles.TextArea.setStyle("border styles" , "solid");
Here is a sample of the text file code:
&content=<span class="headline">Northwest Arkansas Locations</span>
121 Main St.
Russellville, AK 77801
(626) 111-1111<br />
<html><a href="
Loading Text Files With Hyperlinks Into Dynamic Text Field
Describes the mood or content of the topic posted 11-22-06 04:41 PM
I am using Flash 8 and loading external text files in dynamic text fields on my webage. These texts contain html links (<a href="page.html" target="_blank">Click Here</a> and I have "render as HTML" on and "selectable" off in my dynamic text field. Also, I am loading a CSS file. Not only do I not have a hand cursor, but I do not even have any of the text from that piece of html code down. What is going on with this? Please respond asap, as I have been struggling with this for a day now. Here is the Actionscript for loading the CSS:
var flash_css = new TextField.StyleSheet();
flash_css.load("styles.css");
flash_css.onLoad = function(success:Boolean) {
if (success) {
zloc_txt.styleSheet = flash_css;
} else {
trace("Error loading CSS file.");
}
};
var zloc_lv:LoadVars = new LoadVars();
zloc_lv.load("zloc.txt");
zloc_lv.onLoad = function(success:Boolean) {
if (success) {
zloc_txt.text = this.content;
} else {
trace("unable to load text file.");
}
};
zloc_txt.html = true;
zloc_txt.editable = false;
_global.styles.TextArea.setStyle("backgroundColor" , "transparent");
_global.styles.TextArea.setStyle("border styles" , "solid");
Here is a sample of the text file code:
&content=<span class="headline">Northwest Arkansas Locations</span>
121 Main St.
Russellville, AK 77801
(626) 111-1111<br />
<html><a href="
Loading Text Files With Hyperlinks Into Dynamic Text Field
Describes the mood or content of the topic posted 11-22-06 04:41 PM
I am using Flash 8 and loading external text files in dynamic text fields on my webage. These texts contain html links (<a href="page.html" target="_blank">Click Here</a> and I have "render as HTML" on and "selectable" off in my dynamic text field. Also, I am loading a CSS file. Not only do I not have a hand cursor, but I do not even have any of the text from that piece of html code down. What is going on with this? Please respond asap, as I have been struggling with this for a day now. Here is the Actionscript for loading the CSS:
var flash_css = new TextField.StyleSheet();
flash_css.load("styles.css");
flash_css.onLoad = function(success:Boolean) {
if (success) {
zloc_txt.styleSheet = flash_css;
} else {
trace("Error loading CSS file.");
}
};
var zloc_lv:LoadVars = new LoadVars();
zloc_lv.load("zloc.txt");
zloc_lv.onLoad = function(success:Boolean) {
if (success) {
zloc_txt.text = this.content;
} else {
trace("unable to load text file.");
}
};
zloc_txt.html = true;
zloc_txt.editable = false;
_global.styles.TextArea.setStyle("backgroundColor" , "transparent");
_global.styles.TextArea.setStyle("border styles" , "solid");
Here is a sample of the text file code:
&content=<span class="headline">Northwest Arkansas Locations</span>
121 Main St.
Russellville, AK 77801
(626) 111-1111<br />
<html><a href="
Getting Text Information With Hyperlinks Into Dynamic Text In Flash
I have Flash 8.
Here's what I need to do: Get content from an outside source...
http://cms.nichedirectories.com:8080/opencms/opencms/Pennbrook/news.php
to display, WITH hyperlinks, in a flash dynamic text box.
I'm very confused, very lost, and in a bit of a hurry. I don't want to have to go around the issue by breaking the page into three separate flash files, just to make sure the client can access JUST the news file, remotely, and it display in the news area.
Please help?
Loading Dynamic Text With Hyperlinks From A Text File.
Is it possible to load text from an outside source using loadVarsText.load("text.txt"); and have some text bold and other text have html links?
Where can I find how to do this, or is it even possible?
I'd gladly pay you on Thursday
for a hamburger today!
Two Things: Xml Into Scrollpane And XML Derived Actionscript
__________________________________________________ ______________
I have a scrollpane (myscrollpane) and it's data is coming from a mc (mcslider). Mcslider is made up of a looped(to get different data from the XML) instance of another mc(item_holder). Item_holder is made up of two dynamic Text boxes(name_txt, desc_txt) and another mc(b_holder). B_holder is a marker for one of three movie clips (mcradio, mccheckbox and mcqty).
1.) Can I define what movie clip goes into 'b_holder' by making some sort of if statement involving xml attributes?
e.g.{
<item name="Item1">
<info mclip="mcradio" action="predefinedaction1" text="Item 1 text" />
</item>
<item name="Item2">
<info mclip="mccheckbox" action="predefinedaction2" text="Item 2 text" />
</item>
}
and 2.) I am having no luck with calling XML data into the dynamic text boxes in the mc in the scrollpane. Should the XML be loaded on the frame of the mc itself or from the main stage using myscrollpane.mcslider.name.text = "this or that"?
MovieClip-derived Object Not Appearing?
Ach. I have a class that extends MovieClip called AxonClip, and a class that extends AxonClip called Target. I create several new Target objects like so:
Code:
Targets[i] = new Target("Targ"+i);
Targets[i].attachMovie("TargetArt", "TarGuy"+i, iDepth);
Later I update the position of that Target by changing its _x property. This *seems* to happen, as I can then trace(_x) and see that physics things are changing it. However, the clip never *appears* no matter what I do. I suspect this is because my Target class is not actually inheriting all the properties and methods that MovieClip has. If this is the case, is there something I can put in my class declaration, constructor or elsewhere to make sure these things inherit from MovieClip?
Also, is the AttachMovie even necessary, is there a better way to do it like linking a clip from the library to the particular class?
MovieClip-derived Object Not Appearing?
Ach. I have a class that extends MovieClip called AxonClip, and a class that extends AxonClip called Target. I create several new Target objects like so:
Code:
Targets[i] = new Target("Targ"+i);
Targets[i].attachMovie("TargetArt", "TarGuy"+i, iDepth);
Later I update the position of that Target by changing its _x property. This *seems* to happen, as I can then trace(_x) and see that physics things are changing it. However, the clip never *appears* no matter what I do. I suspect this is because my Target class is not actually inheriting all the properties and methods that MovieClip has. If this is the case, is there something I can put in my class declaration, constructor or elsewhere to make sure these things inherit from MovieClip?
Also, is the AttachMovie even necessary, is there a better way to do it like linking a clip from the library to the particular class?
Hyperlinks Or Text Help Plz
I was wondering if there was a way to make text within a flash movie link to another part of a flash movie? I have found away to use a hyperlink to go from a flash movie to a webpage but is there another way to move from different points on the timeline or even just bring up a new flash movie over the top of the original???
any help would be great
thanks
Hyperlinks Or Text Help Plz
I was wondering if there was a way to make text within a flash movie link to another part of a flash movie? I have found away to use a hyperlink to go from a flash movie to a webpage but is there another way to move from different points on the timeline or even just bring up a new flash movie over the top of the original???
any help would be great
thanks
Something A Little More Challenging. Derived Classes And Event Listeners
I have a imageTemplate class which extends my gridTemplate class. In my imageTemplate class I have an onLoad function which looks like this:
Code:
private function onLoad():Void {
super.onLoad();
setIcons();
}
My setIcons() function uses data that is set in my super.onLoad() function. The problem is that setIcons() is getting called before super.onLoad() finishes. I need to force my setIcons() function to wait. I think I can use a dispatcher or an eventListener but I'm not exactly sure how to do this. Any of you advanced actionscripters have a nice solution for this?
Thanks,
Jason
[FMX04] Setting _name On Mc Derived Class
Is it possible to set the _name on an object that is dervived from a movieclip, and is created dynamically?
Example of the problem:
ActionScript Code:
// Level.asclass Level extends MovieClip{ public function Level() { trace("CONSTRUCT Level() : "" + this._name + """); }}// main.flavar a : Level = new Level();
The output is:
Code:
CONSTRUCT Level() : "undefined"
Is it possible to assign it a specific name?
Basic Text Text Scroller Hyperlinks?
Header says it. this is a great little tutorial but what piece of code needs to be put in the value window to make a hyper link show up as clickable? Thanks so much
elkq
Hyperlinks In Dynamic Text
After clicking hyperlinks in a block of dynamic text, the hyperlinks simply ignore "_blank" value I specified. Is it a Flash MX bug or is there a solution ? Thank you for help.
Hyperlinks Within Text Files
Im importing a variable from wihtin a text file:
loadText = new loadVars();
loadText.load("whoweare.txt");
// creating the loadVarsText function
loadText.onLoad = function() {
content.text = this.introtext;
};
and i have the following in the text file:
introtext=Based in the <a href="test.htm">UK</a>,
I clearly want the 'UK' to be a hyperlink but instead the entire string appears as is wihtout the brackets.
How do I get hyperlinks to work here?
Hyperlinks In A Text Scroller
I've just done this tutorial:
http://www.kirupa.com/developer/mx/textscroller.htm
Here's my question...
Can you create hyperlinks inside a dynamic text box? I really hope the answer is yes (but I fear the answer's no).
Thanks in advance.
James
Dynamic Text Hyperlinks
I have a section of dynamic text within a box with a scrollbar. I have an email address at the end of the text that I would like to hyperlink. However, this does not seem to be possible with dynamic text.
Does anyone have any suggestions?
Hyperlinks In A Text Scroller
I've just done this tutorial:
http://www.kirupa.com/developer/mx/textscroller.htm
Here's my question...
Can you create hyperlinks inside a dynamic text box? I really hope the answer is yes (but I fear the answer's no).
Thanks in advance.
James
Hyperlinks With Dynamic Text
I have a flash web page that loads text from a text file. I have tried putting a hyper ling in the text, but when you click it in the page instead of going to (for example)
www.thispage.com
it tries to go to
c:workingfolderwww.thispage.com
How can I work around this?
Thanks
Steve
Notepad Text Hyperlinks
Hi,
I was wondering, is there any way of making hyperlinks in a notepad file and when loaded into a flash movie, through loadVariablesNum, only that text as a hyperlink can get clicked, not the whole dynamic text area?
dynamic textfield in flash movie = fred
I assume in the notepad file you have &fred=what do you put here for the hyperlink?&
any ideas?
Creating TextField Inside A Class Derived From MovieClip
I've got a problem while trying to create a TextField inside an object that is a class derived from MovieClip. MovieClip's method createTextField doesn't return a reference to a newly created object, as do attachMovie or createEmptyMovieClip, so I cannot assign it to a private variable of the class instance. For doing that automatically (as createTextField should do) I declared my subclass as dynamic (so any code can add some properties to it). But this didn't help at all...
So, the code:
ActionScript Code:
dynamic class com.maninblack.ui.Hint extends MovieClip {
// NOTE : some code was ommited, it has no value for the situation
//
private var caption_txt:TextField;
//
public function Hint()
{
this.caption_txt = null;
//
this.initGraphics();
}
//
private function initGraphics() {
if (this.caption_txt == null) {
// this.caption_txt = ... won't work, because the function returns Void (nothing)
this.createTextField('caption_txt', 1, 0, 0, 1, 1);
// and, for example, making it not selectable
this.caption_txt.selectable = false;
}
//
trace(this.caption_txt);
// gives "null"
} // function initGraphics
} // class Hint
I think, attaching some external MovieClips with created TextField in them or creating some internal empty MovieClip that will create a TextField properly inside itself, may work as I need. But I don't want to have a fully qualified MovieClip as just a container for creating a TextField that appears in the scene rarely (as Hints do).
So, how to make ActionScript do the thing?
Thanks.
Adjusting Values Derived Form Stage Position
I've built a Flash movie which includes a section with three interactive sliders.
It is possible to drag each slider between '0' and a maximum which is related to the position of the other two sliders. It is only possible to drag each slider to its absolute maximum if the other two sliders are both set to '0'.
All three tracks are the same length in pixels but the values they represent are different - Track A is 0-500, Track B is 0-1000 and Track C is 0-400 (these maximums could be subject to change). Next to each track is a numerical read out of the 'value' of the slider.
There are three pre-set states for the sliders where there positions are set using the numerical value. From this point it is possible to drag each slider individually.
The problem I have is because the length of the track is only 184 pixels long (this can't be changed) when I drag the sliders manually there are situations where when I slider reaches it's maximum value dependant upon the other two sliders the actual value shown is one or two units short of what it should be.
Switching from Math.round to Math.ceil in the ActionScript that connects to positions of the sliders to the values displayed has improved matters, but obviously on the Track that goes from 0-1000 each pixel is a 5 or 6 unit change in value which means that when the slider reaches it's maximum dependant on the other sliders the value displayed can be up to 3 units short of what it should be.
Can anyone suggest a method by which when a slider hits a maximum imposed by the position of the other two sliders the value displayed is automatically adjusted to give the true maximum value (based on the other two values shown) and not the one dependant upon the track position of the slider?
Thanks and sorry for the long and involved post!
Pass Hyperlinks From Text File
Is there a way to pass hyperlinks into flash 4 from a text file? I would like to pass the link and enable button interactivity using that link.
Dynamic Text Fields As Hyperlinks
Hi all
I am making a website that is composed of several Modules and Sections etc
At the top of each page I want to show the users current location
e.g Product1 * Module2 * Topic 4
The above will be dynamic text based on the current location
e.g Safety * Induction * Facts
How can i make each word a link but still display the whole location without unneccessary gaps
For example if i put an invisible button ontop of each location element - i wouldnt know how wide each button should be as the words will vary!
Any help much appreciated
Thanks
Paul
Text Hyperlinks To Html Docs.
I would like to create text links in flash to external sites that open a new browser window. I would also like to create links that open up a mail window. I have tried using the "URL" field in the character window but it doesn't seem to work once I open it up in a browser. It puts the little dotted line under the text in flash but nothing happens in the browser. Any advice?
Thanks again oh knowledgable ones.
spud
Hyperlinks Inside Of Scrolling Text Box
Would like to create a few hyperlinks of some text inside of a scrolling test box. Any help or direction would not only be helpful, but greatly appreciated. Thanks.
Creating Hyperlinks In A Dynamic Text Box
Hello there,
I am stuck trying to create a hyperlink in a dynamic text box. The text box's data is loaded from a separate text file. I've tried setting the box to read HTML, but that didn't seem to do any good. What I want to be able to do is list the name of a website & allow the user to click this, & then for the website to open in a new browser window. I thought if I added this in the text file I'm loading, it might work:
"A HREF="http://www.site.com" target="_blank">Title</A"
But it didn't, & nothing shows in the text box at all. If anyone could give me some pointers they would be much appreciated. Thanks very much & have a good day
Michael.
PS Sorry about the somewhat mashed up HTML, I'm not sure how to display the line of code here without it actually working!
Hyperlinks In Dynamic Text Files?
how can i do this right now im generating dynamic text files in my flash movie i need to know how i can put hyperlinks in my textfiles
or can this even be acheived if it can can someone out there help
me on this matter i would greatly appreciate thnx. you can also see the attachment for reference
Dynamically Loading Text - With Hyperlinks
Does anybody know if this is possible?
I have a text file i am using to dynamically load text but i want some of the text to link to an external url. Does anybody know of any possible way to do this or any tutorials there might be?
Please respond even if this is not possible
Yours,
Matt
Hyperlinks In A Scrolling Dynamic Text Box?
Hi,
I am trying to create a links page using flash, but cannot work out how to create a hyperlink in a dynamic text box. For a better clue of what I am doing look at www.nickwalkley.co.uk and click 'links'.
I think I either need to code the text as HTML, in which case I am having problems writing it, or apply a CSS file to the text but I can't figure out the code for that.
Your help would be appreciated.
Many thanks,
Nick
Hyperlinks In External Text Files
Is there anyway at all to have flash automaticaly turn URL's in externaly (or for that matter any) loaded text into hyperlinks?
Also, can i get flash to load the "&" symbol? Whenever im loading text from a .txt file into flash the text breaks when flash encounters "&".
JAK
Hyperlinks With External Text File.
Quick question.
I'm pulling text into a dynamic text box on the main stage, from an external file 'mytext.txt'.
I was wondering if I could make any of the text from the notepad file into a hyperlink?
Any ideas?
Hyperlinks Within Scrolling Text Fields
I have flash version 5 and have just added a scrolling text box to my project and need each line of text within the scrolling text field needs to link to different iframes within the html page it sits in. So I suppose simply my question is: how do I make text within scrolling text fields into hyperlinks?
If anyone could help with any hints, it would be great as I am sure it must be simply but I do not know how to go about doing it?
thanks
james
Dynamically Loading Text - With Hyperlinks
Does anybody know if this is possible?
I have a text file i am using to dynamically load text but i want some of the text to link to an external url. Does anybody know of any possible way to do this or any tutorials there might be?
Please respond even if this is not possible
Yours,
Matt
Hyperlinks In Dynamic Text Scroller?
Is there a way to display hyperlinks in a text scroller in which the text is dynamically loaded using variables? I'm talking about the basic text scroller tutorial here on Kirupa.
XML, Dynamic Text Field, Hyperlinks
Hi all,
I've created a MCs which load in data from an XML file into a dynamic text field. The file contains hyperlinks. The links appear correctly as does the text, however, when I move the panels up and down the screen using actionscript, the area on screen which used to contain the MC dynamic textfield appears to have a ghost of the hyperlinks that used to be in that area. I get the hand pointer, even though the hyperlinks aren't present. the links also click through.
I've tried setting the visibility of the dynamic text field to false, but to no avail.
Can anyone help me? Is this a flash 8 bug?
Many thanks.
pinkpantera
Disable Hyperlinks In Dynamic Text.
Hi, I have a text field which displays text loaded from xml. The data is rendered in htmlText. How can I disable the hyperlink if that hyperlink is clicked?
Rin
Dynamically Loading Text - With Hyperlinks
Does anybody know if this is possible?
I have a text file i am using to dynamically load text but i want some of the text to link to an external url. Does anybody know of any possible way to do this or any tutorials there might be?
Please respond even if this is not possible
Yours,
Matt
Hyperlinks In Dynamic Text Scroller?
Is there a way to display hyperlinks in a text scroller in which the text is dynamically loaded using variables? I'm talking about the basic text scroller tutorial here on Kirupa.
Actions/Frame Text Hyperlinks-PLEASE HELP
All I want to do is create a simple hyperlink for this text and I have been working in the Actions Area/Text Variables:Frame/ and no matter what I have tried nothing works...I have been everywhere looking for help...if someone could just show me what script to use for ONE of these items I would be ETERNALLY grateful!
PLEASE PLEASE PLEASE!
(This is exactly how it reads now because I couldn't figure out how to make active links)
text ="<b>Ultimate Trade Shows:</b>
www.tsnn.com"+newline+newline+"<b>Seminar
Information:</b>
www.seminarinformation.com"+newline+newline+"<b
>Juvenile Product Manufacturers Association:</b>
www.jpma.org"+newline+newline+"<b>GiftWare
News:</b> www.giftwarenes.com"
Carousel Hyperlinks In Text Description
I was wondering if anyone knows a way to play hyperlinks in the description for the items in the Carousel. So for example you have 5 items in the carousel you click on one it moves to the upper left and you get the description that comes up. That description is in the xml document and seems to be just plain text. Is there anyway to add html to it like to have a word link to another page?
Thanks in advance and hope this makes sense
PS I tried messing around with CDATA but couldn't get it to work.
Here is an example of what I want.
To see more about this item you can click Code:
<a href="www.anywhere.com">here</>.
Popup Windows Hyperlinks In External Text?
Hi,
I've not come across any tutorials on the subject of pop-up windows (small pop-ups not "new browser windows"), using hyperlinks in external textfiles....Maybe it can't be done. Does anyone know if this is possible and if so, how do you do it?
Hyperlinks In Dynamic Text Loaded From .txt File
just didn't know if it was possible (very new to flash, less than a week)
I've got my text files set up and loading into a dynamic text box on one of the pages of a website I'm doing, but I didn't know if it's possible to set up a hyper link from within the text file, so that I could just add links in there.
|