ActionScript 3.0 :: Checking If Variable Is Provided?
Jun 28, 2009
Is there a good way to check if a variable has been passed into my flash movie?For example lets say I have an app that looks up some data based on location. And I allow for it to be added to the HTML tags, In Flash how to I say set a default location in case of there not being one in the HTML tags?
View 4 Replies
Similar Posts:
Jul 14, 2009
Google is ranking my site preety high BUT (bigBut) in MOST searches it lists my swf-s not html pages. So when clicked they are shown in a browser window as single swf-s, not as part of html page. I am trying to workaround this by means of some variable to inspect if swf is opened as standalone or within a html.Here is the problem. I've set up a swf (swf_01 for example) in html page that loads another swf (swf_02) which is in swf_s directory. Swf_01 establishes a variable _global.isActive = 1; when html loads swf_01. So if swf_02 is loaded into the swf_01 variable is TRUE and that is OK and if the swf_02 is loaded directly from search results as a standalone swf it's not OK. That works so far. In swf_02 there is a code that checkes if variable is undefined (meaning that swf is loaded directly from search results) and, if it is, loads the right html into "_self".Somehow it's not working. Maybe my code isn't right.
Code in swf_02 (loaded one):
/if(isActive==undefined){ loadMovie("http://www.mydomain.com/index_services.htm", "_self");} // meaning: if variable is not true > this swf is loaded into browser directly from search
[code]....
View 7 Replies
Aug 25, 2009
I need to know if it's possible to check to see if a variable contains any information or if it's just blank basically I have a text file on the server that may or may not have a url in it, I have my flash file programmed to grab the url from that text file and apply it to a button that when clicked brings up that URL...but that text file may not always have a URL in it, so for those times i want the button to not be clickable, or at least not attempt to go to a URL.
[Code]....
View 1 Replies
Jun 14, 2010
Imagine I had a variable called X.Let's say every 5 seconds I wanted to make X = true. (it could be either true or false in between these 5 seconds, but gets reset to true when the 5 seconds are up).
Would it be more efficient to check if the value is already true, then if not, reassign it to true? Or just have X = true?in other words, which would run faster?
if(x==false){
x = true;
}
vs
x = true;
On one hand, the first program won't mutate the variable if it doesn't have to. On the other hand, the second program doesn't need to check what X is equal to; it dives straight in.
View 4 Replies
Dec 11, 2009
I want to do something like this in Actionscript 3:
if(variable is Object) ...;
else ...;
Where variable could be a String(), Number(), Array(), Object()...Currently the above check returns true for all of these types, which makes sense. I only want it to return true for objects made with new Object(), however.
View 2 Replies
Nov 28, 2011
I'm attempting to make a platform game. Each level is contained within it's own MovieClip, which has it's own class. Each of these classes extend the Level class, which provides basic functionality for all levels.
Each individual level has a numPlatforms variable which stores the number of platforms in that particular level. I currently have a for loop that runs from 1-numPlatforms and sets the level area (the image, more or less) the platform contains:
[Code]....
Is there any way to check if a variable exists within a MoveClip? I've trying comparing it to null and also to undefined, but neither works.
View 2 Replies
Oct 2, 2009
Just wondering if the zoom function on this link on the picture is done via flash and if so whether anyone can assist me in working out how to do it -
View 1 Replies
Sep 14, 2009
I am trying to write a small flash app which will load and display images provided as a query. My flash app works fine when I provide the image path directly in the browser address bar, but it is not working when I do the same using html.Here is the direct link to the flash appThe Html code is attached with the post.I know my app is getting invoked and it appears to work fine when I hardcode the image url into the flash app. But the query method just does not seem to be working!!This is hosted on a linux site supporting php.
View 1 Replies
Jan 19, 2011
Some of the "skins" for the FLVPlayback component cannot be used as delivered in the Flash Professional CS5 package.
For instance, if you try simply to run the .swf file: MinimaSilverPlayBackSeekCounterVolMuteFull.swf in Program Files/Adobe/Adobe Flash CS5/Common/Configuration/FLVPlayback skins/ActionScript 3.0, you get the following error message:
VerifyError: Error #1014: Class fl.video::UIManager could not be found.
Such a skin cannot be used in a published application (though it will work within the Flash IDE in Test mode).
Not all the skins have this problem. However, at least all of the Minima prefixed ones do. Of course the one I wish to use is broken. Is there a way I can fix this? If I try to publish the corresponding .fla (in FLVPlayback skins/FLA/Action Script 3.0 I get "Warning: unable to load SWC FLVPlaybackAS2.swc".
View 16 Replies
Apr 19, 2010
is good practice to use if(source==null) in my costructor, to run code only if the costructor argument is provided ?
package dataModels {
import mx.collections.ArrayCollection;
import dataModels.*;
[code]....
View 1 Replies
Jul 21, 2011
I need to provide a link (like Click here to view.....) in a AlertBox that redirects to another page.
View 4 Replies
May 28, 2009
I am using a custom advanced auto-complete component. Selected items do not have a tooltip by default, but I would like to use the label as my tooltip. The arraylist allQuestions is the dataprovider to my component.
[Code]...
allQuestions.questionText should is the path to my desired label. I have looked into using events, such as event.currentTarget, but I dont think they exist for tooltips. how to add a tooltip using the data provided to the component?
View 1 Replies
Mar 14, 2011
I am trying to build a DVR Cast app using DVRCast 1.2 provided by Adobe. The problem I am facing right now is that I am finding difficult to record multiple streams at the same time so that I can make dynamic stream to work correctly. Even though Adobe has provided DVRControllerSynch, it does not mention anything how the streams are recorded.
View 4 Replies
Nov 3, 2011
i placed a movieclip inside a movieclip A_Mc ( representing ClassA) . Now if i place another movieclip ( without naming, and making sure that automatic instance naming is Off via the flash IDE ), everything runs fine. But when i provide an instance name say b_Mc , then it MUST be able to be publically accessible. What is the logic behind this setup. Why while designing i cannot make a sub-movieclip which is private and inaccessible to others?
View 3 Replies
Nov 11, 2009
I have been trying to use API provided by tringme to create widget to make a call. I am unable to get more information from tringme support about connecting. I assumed that the call wasn't through due to insufficient credit. Even with sufficient credit the call doesn't happen. Have any of you people work on it any time?
I have written the code as per the API, <uid> has been replaced with a valid uder id.
Code:
var tringMeURL:String = "rtmp://sip.tringme.com/voicemail/<uid>";
var randomstreamname = "63e457425defb24e8a5ca80de80d2e3817ea5c1b";
NetConnection.defaultObjectEncoding = flash.net.ObjectEncoding.AMF0;
[Code]....
View 2 Replies
Feb 29, 2012
I don't think this is possible, but is there a way to validate the arguments a callback accepts. For example someone passes me callback "mycallback", I want to assert it accepts an argument String.
public function addHandler(handler : Function) : void{
//pseudo code
Assert.functionAcceptsArguments(handler, String);
}
View 1 Replies
Mar 1, 2012
I want in my application show multiple markers on google map .only address of the city or country is provided but without latitude and longitude of the city
View 2 Replies
Dec 14, 2009
I'm trying to make a basic flash calculator except it only has to be able to square the number provided by the user, I have followed many tutorials but I keep getting the NaN as the output. Here is the actionscript:
import flash.events.MouseEvent;
square_btn.addEventListener(MouseEvent.CLICK,
squareClick);
[code]...
I also need to have Input box and Error Messages & Highlighted Input Box.
View 1 Replies
Sep 29, 2010
So with the help of others, I figured out the runtime font loading issue, and all was working great.Until we moved to the live environment, where apparently Flash is freaking out if I load my swfs from [URL]..
Can anyone tell me what I need to do to fix this? Here's the error:
Code:SecurityError: Error #2112: Provided parameter LoaderContext.ApplicationDomain is from a disallowed domain. In short, here's the structure. A Wrapper swf is embedded on a page.The Wrapper loads a child Player swf into a separate Application Domain, and then calls a public init() function in the Player to get things rolling, passing into the Player swf a reference to that newly-created ApplicationDomain the player was loaded into.At some point the Player decides whether or not it needs to load an external font Library swf for embedding subtitle fonts. It loads the font(s) as needed into the same ApplicationDomain that was passed into it (should be the same one it was loaded in itself, no?).
Once again, I've tried all sorts of combinations of code changes, but nothing seems to be fixing it. It all comes down to whether or not the original Wrapper swf is embedded via "www.domain.com" or "domain.com".
FYI, I have a crossdomain.xml file set up allowing both combinations of the domain name, and in each loaded swf (the Player and the font Libraries) I have a Security.allowDomain(); set with both combinations of the domain name as well. I resolved a similar security error similarly (a different externally-loaded swf), but that doesn't seem to be working for this.
View 7 Replies
Mar 26, 2010
With swfobject 2.2, how do you specify the desired version of flash you require? I need flash 10, but swfobject won't perform an upgrade install with the provided expressInstall. swf in the swfobject 2.2 distributable. How do I get an upgrade install to occur for flash 10?
View 1 Replies
Sep 16, 2011
I would not have asked the question if I owned an iphone, but so far I only have an android phone for development.
The question is: Should I use the View.viewMenuItems that are provided by flex mobile? Or should I better embed the functionality in another way? I don't know what possibilities might exist on iphone to open the menu, because it has no hardware button "menu".
By the way: How could I open the menu in the Flash-Builder mobile device emulator - there are no buttons, too..
View 2 Replies
Jan 13, 2010
I have a Flex application which manage a database composed by 7 tables.I have created the insert form and all work great. Now I wanto to improve the Form performances; the idea is to replace the TextInput of the Form with ComboBoxes which are provided by the DataBase tables
View 1 Replies
Oct 14, 2010
I have developed a player in AS3. It is working if i provide the IP of the website. But, it is not working when i provide the full domain name. Even, i provide the crossdomain.xml for global access.
View 1 Replies
Jan 3, 2006
f you know PHP...then you know that you can create a string variable...and then use the value of that variable to declare another variable. like this:
PHP Code:
<?php$foo = "haha";$i{$foo} = "success";print $i{haha};?>
and it would display "success"...or like this:
PHP Code:
<?php$foo = "haha";$$foo = "success";print $haha;?>
and it would also display "success".
View 6 Replies
May 26, 2009
I have a gallery loading jpegs from an xml file into a mc called mainPicArea, on frame 5. I have other content on frames 1,2,3,4,6,7.
I want to run an if statement to check whether mainPicAreaexists and if it does, then run a removeChild(mainPicArea), and if not do nothing.
[AS]
if (MovieClip.mainPicArea){
trace("exists");
//removeChild(mainPicArea);
[code]....
When I test, it comes back with the trace "doesent exist", even though it does exist.
View 5 Replies
Sep 8, 2009
I must admit I have struggled with this thing for a bit. It seems simple but for whatever reason I can't get it to work. I just want to make something move in AS 3 right now, and so far I've tried puzzling together two different tutorials, but both of them are missing either some source files or further explanation.
Anyway, here is the code (The bit I am having problems with)
Code:
//event listener checks for key presses
stage.addEventListener(KeyboardEvent.KEY_DOWN, checkkey);
//Create keyHandler function
[Code].....
The problem is the checkkey function in the update function. If I leave the parenthesis empty it tells me it needs an argument, if I leave it like that it tells me I need a right paren before colon.
View 2 Replies
Jan 7, 2010
What kind of code would one need to check for collisions between two symbols? I am hoping to become a game designer so this is important for future references.
View 8 Replies
Feb 15, 2010
I have a gallery loading jpegs from an xml file into a mc called mainPicArea, on frame 5. I have other content on frames 1,2,3,4,6,7.I want to run an if statement to check whether mainPicAreaexists and if it does, then run a removeChild(mainPicArea), and if not do nothing.
code:
if (MovieClip.mainPicArea){
trace("exists");
//removeChild(mainPicArea);
[code]....
this is my code. When I test, it comes back with the trace "doesent exist", even though it does exist.
View 5 Replies
Oct 20, 2010
why this code works on my other flash file and it doesnt on the new one. This is the code:
if (test == "PRIZE1"){
trace ("prizes/prize1.jpg");
}
[Code].....
Basically it should check whther the variable has any of the above words loaded on it dynamically so that it loads a movie that corresponds to it. I put the trace on the above so I can track whther it was reading or not. Obviously it wasnt. My publish settings are Flash Player 8 with Actionscript 2.0
View 4 Replies
Aug 28, 2009
I want to know how to check whether a SWF is loaded or not.
View 10 Replies