ActionScript 3.0 :: Hard-coded Playlist XML Url Into Flashvar?
Nov 19, 2008
So right now, I have a video player that pulls in all sorts of info (flv url, caption file url, video title, description, preview image, etc.) through an external xml file (playlist.xml). It works great, but I need to change the coding so it's not hard-coded into the FLA, rather from the embed code for the swf.
Here's the chunk of AS3 code that's involved in the original loading of the XML data as well as the html text too.
I've got a transition after clicking on a moie clip that goes like this:[code]The mcName variable is a Movieclip delared in the first frame, and set with the name of a movieClip in the onRelease of a button instance:[code]It does take the variable into the FadeFrame function, but doesn't work.It comes out in trace as undefined with the _alpha property.If I hard code the movieClip name into the setInteval it has no problem.Any reason why it doesn't want to operate on the movieClip alpha this way?
I have a list component that has hard-coded labels on it (for testing). I then rotate the list component 90-degrees and notice the text disappears(during design time).
I test the file and the labels do not show up also during runtime.
I can get the labels to show if I rotate the component back to its' original state.
if someone can shed some light to this matter... i'm pretty new (somewhat) w/ AS let's say, i got an .swf (voets enahnced mp3-player) @ [URL] --which works perfectly at the moment. i then referrenced this .swf in [URL] --which doesn't work prolly because the .swf is calling the XML (i.e. "onlineplaylist.xml") relative to its whereabout, which is /test08. the question is, is there any way around this problem, so that if i put all .SWFs in a certain location (server/directory/what-have-you...), and referrence it from another server &/or directory (like above), it would work?
Im playing around with the last.fm api... Specifically the "getLovedtracks" call.... [URL] This is a weird one that I have never come across... The above call requires a username to return a track listing so if I hard code the username into my class like this.... var username:string = "aidanmack" No problems the call works... if I make that username equal to a dynamic text box string that has "aidanamck" typed into it.. so something like... var username:string = mystage.textbox.text
the last.fm api wont except this... I get user does not exist But if I check the call with the charles proxy Flash is defo sending the username "aidanmack" So I wonder if its to do with have how last.fms api interprets the string?
Is there a component anyone knows of that will take XML and display it has a color coded string so you can read it easily? My app runs mostly from the dynamic XML that is loads. It would be great for debugging if I could click a button in the app to show me the XML it loaded in a readable format.
I'm constructing a game for college and I've run into a problem. I've created a drag and drop game,I have 9 instances called "case_01", "case_02" etc. The user must place them into one of two boxes (called "input_01" and "process_01"). I've then created an incorrect message on frame 3 and a correct mesage on frame 5. I've placed the following code on the submit button with the correct answers:
[code]...
but this isn't working correctly. Must each if have an else? I'm a complete novice at this actionscripting
I am trying to complete my navigation bar. I have the onRollOver / Out and Release states finished, my only problem now is that onRelease is not reversable. Once I click on another button, my previously pressed button is still in its down state. All my buttons have been created dynamically with no timelines involved. He is the button code that is within a for loop:
[code] navBar["myBtn"+i].onRollOver = function() { //create pointer mc over button
i want to add a SWF metadata tag to an ActionScript Project in Flash Builder 4, that denotes the default size and background color of the swf. i can do this in Flash Professional, but it doesn't work with ActionScript projects in FB4? can i not include this tag? i know i can set these properties in the properties panel, but i'd like to have them in my code.
I have a depth issue with two movie clips. One of the movie clips I am creating is created with the createEmptyMovieClip function. the other I've embedded onto the 1st frame manually.The one I have embedded manually will not show on top of the one I've created in code. I've tried giving minus values to the one created in code and the manual one still
I have this game where there are moving targets(I move them by code) and you need to click them and every time you click them you get 5 points and they disappear I also made a 30 second timer to and when it hits zero it goes to a frame 7 (Game Over frame).[code]
I've got a couple of TextField initialized in code (as3). They use my embedded font (aharoni), and that just works. But the fonts that i've written directly into the movieclips in flash cs3, just don't work.
When i play the swf on another computer that doesn't have aharoni, the coded TextFields are aharoni, but the textFields in the movieclips that i've written directly are Times new Roman, because that computer doesn't have Aharoni. I've set the text font to my embedded font.
My client has a simple shape that they want the user to be able to animate, i.e. it looks like a single square on the stage, but when you grab it and drag, a load of squares appear and fan out from the corner of the first. I was thinking, I can easily achieve the first part of this by attaching, say 20 movieclips of my square to the stage, but I'm not sure how to approach the back/forth draggable aspect of this.
I have a website project to finish on monday and I'm with a huge problem. I need to create textFields from AS3, load it's text from xml and use loaded CSS file in it. I've embedded the font but it doen't work, and worst, not working even with Times or Verdana fonts. I have embedded the fonts using default name, "Font 1", etc, since I read those export names must be different then system font name. Here are the code (bad one, only to show the problem), the CSS, and the capture of the swf is here:
I was trying to code a rollover rollout dropdown menu in code. I made a movieclip in the library which imports a rectangle sprite. The rectangle sprite moves down on frame2 and back up on frame3. When I called the frame from document level it gives me following error:
how i can to know if the value of a FlashVar (in as3) has changed. For example: if i inicialize the flashVar with "1" and after set the flashVar to "0", everyOne knows that this flashVar has changed. the problem is if i have the FlashVar value setting in "2" and i set the flashvar value to "2", again.
There are any way to know if this flashVars has changed his value for the same value?
how i can to know if the value of a FlashVar (in as3) has changed. For example: if i inicialize the flashVar with "1" and after set the flashVar to "0", everyOne knows that this flashVar has changed. the problem is if i have the FlashVar value setting in "2" and i set the flashvar value to "2", again.
There are any way to know if this flashVars has changed his value for the same value?
We need a second parameter added that sets the destination/target for the link. The default/current is _blank but we also need to be able to set this to nothing so it opens in the same window. Can you try adding the second parameter to the flashvars list and use this to set the target for the link.
How to I add that second parameter of opening in same window to the flashvar?I believe you separate the additional one by using a & but am unsure exactly what to put?Do I also have to change the ActionScript in the original fla file? This is set to _blank but I believe they want it to stay that way but have the option of adding _self or whatever it needs to be in the Flashvar when needed.
My ActionScript 3.0 is:
btnLink.addEventListener(MouseEvent.CLICK, buttonSymbol_click); function buttonSymbol_click(evt:MouseEvent):void { var req:URLRequest = new URLRequest(stage.loaderInfo.parameters["url"]); navigateToURL(req, "_blank"); }
I'm passing in a variable from my FlashVar parameters: gameToken, which will control the visibility of several objects through out my movie. The objects are in different frames and all have different labels: review_btn, introReview_btn, endGame_btn. gameToken is being randomly generated by the clients 3D environment, and then passed in the embed code. gameToken would look something like this:
[Code]...
I had some success using this method before, but only for a single object. Now when I try and repeat the method with the various other objects all I'm getting is a headache. At no point in my movie does gameToken ever get set to anything other than null (I'm not testing within my webspace yet).
I am trying to embed a variable title into flash by way of flashvars. It works great in Firefox and Opera so I know it works, but for some unknown reason I just cant get it to work in IE8
Here is the code I am using to embed the flash <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="200" height="12"> <param name="movie" value="themes/$themename/images/sideblock/blocktitle.swf" /> <param name="quality" value="high" /> <param name="wmode" value="transparent" /> <param name="flashvars" value="blocktitle=$title" /> [Code] .....
I've just completed a flash banner for our site and my boss has just informed he's bought some bannerad software to manage clicks, etc. Originally my flash was passed variables from the HTML via Flashvars which I accessed using something like this: var manid = root.loaderInfo.parameters.manid Which worked great. But now that the variables are getting passed like this (which I have no control over):
I have been grappling with this problem for days now. I want to set two variables in a SWF and have them passed to FlashVars PHP page. I can get it to work when I just send one variable with this code:
I'm trying to call my flashvar and load it in my xml.
but i'm getting an error: TypeError: Error #2007: Parameter url must be non-null. at flash.net::URLStream/load() at flash.net::URLLoader/load() at test_3d_fla::MainTimeline/frame1()
1. I have a flash file which is loading php variable through flash vars. 2. The flash var variable contains the .txt filename in which data is kept. 3. When I open the php page the swf loads with variable having .txt filename and value containing swf path. 4. I have created timer in flash which check for change of value. 5. When value changes the other flash file loads. 6. All this works fine in all browsers except IE 7
I get flashvars that I call with php link like this : "movie.php?id=2" The flashvar ID is well get in my movie and appear in a textfield, but the code I use to change the combobox don't work: rssComboBox.setSelectedIndex(id);
Is it possible to retrieve flashvar parameter in mxml code and if so how? Up to now i have been using Application.application.parameter.name to get what i need.
Is it possible to load xml as a flashvar? Basically I want to pull information from a server for a news ticker, but I want the info to be available as or before flash loads so that it appears to be instantaneous. Can xml be passed in as a flash var or do I need to break down the feed into individual vars that get passed in?
I'm not talking about passing a URL to flash, I mean that actual XML. Basically I just want all the data there and loaded on the same page as the flash so there's no load times.
Is there something I can do to make it so that a flashvar can contain any sort of punctuation and not break the html code? Like some sort of encompassing brackets or something? Right now if I try to include some long strings that have quote marks or other characters that could have some sort of meaning in the code, then it tends to interpret it as code rather than a string. Anything I can do?