ActionScript 2.0 :: Attach Links To Variables
Jan 31, 2007Here is the setup:
[Code]...
That code didn't work. if there is too much information please let me know and i will cut it down to make sense.
Here is the setup:
[Code]...
That code didn't work. if there is too much information please let me know and i will cut it down to make sense.
I have a set-up a movie to dynamically load text from a text file. Now I realize that I want to attach live links to some of the urls in the text file. My question is can you attach the links in a text file by putting html tags in there or is it better to turn the text file into an XML file with the tags in there?Also can you attach CSS styles to that text file.. for instance in addition to adding links to the text I would also like to change the color of the text.
View 1 RepliesI 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'm working on a game. I want it to attach a different level to the stage depending on what value a 2 variables are, but I keep getting Type Mismatch, or it doesn't work.
Code:
_root.attachMovie(PROBLEM IS HERE,"map"+mapSwitch,_root.getNextHighestDepth());
The current linkages are 00 (0x, 0y), and -10 (-1x, 0y). They are comprised of 2 variables, the first one is xmap, and the second is ymap. I want to be able to combine the 2 variables and then attach the clip with that linkage to the stage.
I am working on a portfolio site that is almost complete and I am having trouble with one final bit of the flash. The flash in question is located at fluid-[URL] You click on one of the large gray words i.e identity to pull up a lightbox window with the flash in it. My question is this, How do I set it up so that when each one of the different categories ( identity, advertising, web...) is clicked on the html page the coresponding categories is cued up in the flash? As of now all of the links simply open the flash with the first category but I would like them to open their own category instead. I understand that html can pass variables into flash but I have no idea where to start.
View 1 RepliesI am wrapping my brain around OOP in AS2. I am making two posts on two different subjects. My question here is: when should I use local instance variables, and when should I attach new properties to the instance object? (Feel free to correct my terminology.) Let's say I have a class for a scrolling background, which scrolls when I mouse over its edge. I want to put these values somewhere:
1) How wide is the border in which a mouseOver makes it scroll? This is basically a semi-constant I set it up once and keep it the same, unless the user changes it in an options menu to make the border wider or narrower. Call this scrollBorderWidth.
2) How fast is the background scrolling now? I want to track this so I can smoothly change the scroll speed over several frames. This is often changed. Call this scrollSpeed.
It seems I have two ways I can store and access these values and darned if I know which is better practice. METHOD A: Make them local variables in the class, so the scrolling background instance has them as local vars. I set them up thusly:
[Code]....
how to eliminate previos attach before move to next attach MC..let say as u can see in my code..I just settign the interval..for 2 second..in other to attach the mc on eby one...so how to set up the code so that if the 2nd mc has attach it'll remove the 1st one attach for certain time...and so on..the scenario like this..
mc1 attach
after 2 second
mc2 attach --> remove mc1
after 2 second
[code]....
I have a menu once clicked it animates out a menu that holds a couple of links, but with my code I can't select the links.
[code]...
i created a flash slideshow with pictures of events and link each picture with its own event (ie. each pictures has its own links to the website). I created the fade in and fade out effect using the class motion tween. With the link, I created a layer with a button that has alpha= 0 (so the user don't see it) and then I used code snippet to make another layer with the action script "click to go to url."
When the slideshow goes to the last picture I made it fade out and the first picture of the slideshow would show up and then the slideshow would replay itself (by default?). My goal is to make a continuous slideshow.
When I tested the swf file, the first time it runs, everything is right. The urls and the pictures are in correct order. However when the slideshow replays itself automatically, I notice that the links are incorrect. In the first play, when I click the picture of the event it would open the url of that event.However when the sldieshow replays, clicking the pictures would only open the url of the first event picture. When I click on the 2nd, 3rd, 4th, etc.pictures the browser opens only the link of the first picture of the slideshow.
code for disabling and redirecting links in the HTMLLoader:
Code:
import flash.html.*;
import flash.net.URLRequest;
[code]....
I've got a PHP script that searches for links in a block of text and converts them to HTML values. The $message variable is then entered into my database using a simple INSERT. So far, so good. Then I have Flash parse the message using XML:
ActionScript Code:
function messStyling() {
messCSS = new TextField.StyleSheet();
var messCSSURL = "include/links.css";
[Code].....
The problem, however, is that my links don't work. The rollover works from the CSS styling, but the links don't actually go anywhere. When I rollover the links, the hand cursor doesn't appear, and clicking only serves to change the color back to the non-hover value.
I'm writing some code in Flash MX 2004 and everything works fine except for the last button (4DSystemsProducts).According to the coding if none of the drop down buttons work it should go to products.php, but for some reason it goes to 4DSystemsProducts.php. All of the other menus are coded the same way and work fine, if I take out that button it works fine,or if I take out button 7 and switch 4DSystems to button 7 everything works.Here is the code to clear up this explanation. [code]....
View 5 RepliesI want to add links to 3 different external html pages in the place of th 3 my trial links(which are on the timeline) Here is code, this creates the three buttons listed in var catBtmmenu_label Array:
Code: Select all// Catalogue Bottom Button
//stop();
//hide button on the stage[code]..........
I dont know how to assign links to dynamic created buttons.
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 am trying to have multiple links off site but have hit a brick wall. If I have the code listed below, it opens the second link as soon as you open the links page, If I have the"function onLinkClick (evt)", above btn6_btn I end up with the duplicate error message. Is there a way to have multiple link buttons on a page. I have played with this for hours.
[Code]...
I have an empty SWF that's sole purpose is to call loadMovieNum and start the project. Each loaded movie has a few variables defined within them - unique to those loaded SWFs. Instead of declaring all the variables in each SWF can I declare all of them in one place, in the first frame of the empty loader it all starts from? I'm thinking I can then declare a variable which each loaded movie can increment as needed for me.
View 2 RepliesHow do variables true/false custom variables work in flash?
For example, what I want to do is create a simple true=false variable that I can call on an if statement later.
For example:
Code:
Var1 = true;
if (!Var1)
{
[Code]....
I noticed that neither the "Var1 = true;" part or the if(!Var1) part worked in flash.
How can I make a bunch of variables from a for loop. for example for (var i=0; i<total; i++) {var bunch(i);}. that i make a bunch of variables named bunch1, bunch2, bunch3. I keep getting errors. I program and use so many different languages that I dont know if that can be done with AS3. my only other alternative i can think of is to create some sort of event dispatcher object array. but I dont know how to get them all to send events to one listener with there index number.
View 5 RepliesI have a list of strings that I add to an array, then attempt to set those values in a for-loop using data that I read in. The array gets updated, but the values the array contains do not. I also have an array of buttons that I update this same way that works great, but strings don't seem to work the same way. I have tried moving the string array to give it full scope, and still nothing...
public class test extends Sprite
{
// Declare a list of strings
protected var title0:String = undefined;
[Code]....
I'm writing code that takes data from mysql that's processed by a PHP script. It's actually a bit bizarre, at least to me. Anyway, here's some basic AS3 code that's moving toward what I want to do:
var loader:URLLoader = new URLLoader();
var urlRequest:URLRequest=new URLRequest("receive.php");
urlRequest.method=URLRequestMethod.GET;[code]....
For some reason, the statement "trace(evt.target.data);" produces a whole pile of garbled text before the actual stuff that it's supposed to show Because of problem #1, I've had to include a throwaway variable at the beginning, otherwise the first variable I try to pass into AS3 comes back as undefined. This causes errors when I run my flash movie in the IDE, but when I run it from the browser it doesn't seem to have any effect.But this is the strangest thing of all whenever I make any changes to the database (and subsequently try to load data from different variables), the new variables come back as undefined. For example, let's say that I add another entry to the database, and decide to load students 2, 3, and 4 instead of 1, 2, and 3. When I do that, any new data I've added comes back as undefined, even though when I view the PHP output in my browser, it looks just fine.
And now for the REALLY bizarre part: I'll copy that output, paste it into my PHP script as an echo statement, comment everything else out, and my flash movie runs fine. Even though the output from the PHP script is exactly the same, it gives me errors.
There is a bird, and you control its upwards movement with a key. It has thrust, gravity, it works fine. The problem is I have a bunch of icicles that come at the bird that he is supposed to avoid. I tried this first with math random to use as an x coordinate and than move across the screen, but the icicles had the same x-coordinates sometimes. I tried does not equal(!=) but that doesn't work. I made an array and each number that came out of the array I assigned a different variable. This works fine. I put this variable into the x-coordinate such as mc.x=((n)*60)+480. I did this for five different icicles. All their differnt variables have a different value, and I put them into the same function for each individual video clip, but they still don't go to the right coordinate. Here is the test code just for the initial coordinate of each icicle before it moves...////////////////////////////Quote:
var temp:Array = new Array()
for (var i:int=0;i<8;i++) {
temp.push(i);
[code]......
i am trying to do a loop to create several variables to aasign each one of those variables one number.when i write
[Code]...
I have 2 loadVars - myVars, myPictures
basically i have defined their onLoad functions
so in myVars, i call for
Code:
myPictures.load("http://www.fakedevil.com/lurgee/pictures2.php?id="+this._parent.link2.text+"&time=" add getTimer(), "");
pictures2.php is working cos I just check so by rite the variables loaded should change.. but somehow each time I check those variables in myPictures.onLoad, the variables are always the same.
Basically I just want to attach a movie from the library into a movie clip on the stage.
View 2 RepliesI was wondering if there's a way to attach objects to one another. Basically, for a flash animation, I have a monkey swinging back and forth on a branch. The transformation point is set at his hand on the branch, while his arm swings back and forth like a pendulum. His body is at the bottom of this pendulum, and right now I have to reset the body as his arm swings.
How do I attach the body to the bottom of his arm to its own pivot point so that they're always attached to each other, but so that the body always is in the SAME POSITION (i.e., when you rotate the arm, it does not also rotate the body).
I am trying to load variables from a text file, and have them available from then onwards in the movie, globally so to speak.
While I can read the variable values in a loader function which executes when the text file is loaded, I don't seem to be able to keep those variables available afterwards.
I'm trying to figure out which is more efficient in terms of memory and speed. What I'm doing is having a series of messages loaded to the screen. Is it just faster to write them in string variable or in an XML document which is more versatile in terms of editing and adding on to the document.
View 1 Repliesiam trying to append 3 variables to a url that already has 2 variables appended .. iam using the LoadVars -> "send" method but it wont work. it works if i use a url like "form.aspx" but it wont work if i use "form.aspx?var=nun" which is what i need so i can append 3 more variables to that URL.
View 1 RepliesIs there a way to attach one movieclip to another, replace one with the other or put one inside the other without them having to be in the library?
View 1 RepliesI want to attach a pdf to my CV button . I have written this script on the button;
on (release) {
getURL("cv.pdf");
}