Jump to content

ashwani_nair

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by ashwani_nair

  1. Hi,Tanks for explaining the problem.I can think of a workaround, and I am not sure that this is the only or the easiest way to acheive this.I have written codes in flash to call a javaScript function in HTML page and which will navigate to the section of the page.In flash file my1_mc.onPress = function(){ getURL("javascript:openNewWindow('" + "#go1" + "');");}my2_mc.onPress = function(){ getURL("javascript:openNewWindow('" + "#go2" + "');");}my3_mc.onPress = function(){ getURL("javascript:openNewWindow('" + "#go3" + "');");} and in the <head> tag of the html page <script language="JavaScript"><-- function openNewWindow(myURL) { window.open(myURL); } --> Anyway, this wont work in local machine as the flash player will block the java script in local machine, but it will work through a server. ( I have tried it )Just try it and R&D with it.Hope I was of some help to you..CheersAshwani
  2. Hi There,If you dont want the content to open in the new window, you can leave the second argument blank, that will open the document in the same window.You can also write Java Script in flash.instead of "_blank" you can also use "_top"just have a look at help for getURL, if this is not helping you, i may help you if you could tell me the exact situation.CheersAshwani
  3. Hi Anna,I dont have much idea about MXP, just have a look at this link.MXP referenceMaybe you find something informative.
  4. Hi,If u use dreamweaver then u can directly give a URL to the flash object, but I am not sure about it.And the other way of doing it is say if your swf has a link text or a button in it, u can associate the flowing script to it. myMC_mc.onPress = function(){ getURL("www.mylink.htm","_blank");}[\CODE]Hope I was of some help.
  5. Hi Ben,I dont know how much of help my comments will be, but still just giving it a try.Try to load XML into your movie. Use the XML Object ( not component as I dont find it comfortable working with it)usevar myXML_xml:XML = new XML();myXML_xml.onLoad = function(success){// success = false if xml fails to loadtargetNode = myXML_xml.firstChild.firstChild.firstChild;linkName = targetNode.firstChild.nodeValue;linkTarget = targetNode.nextSibling.firstChild.nodeValue;generateMC(linkName);}function generateMC(linkName:String){ righTab_mc.tab1_mc.link_txt.text = linkName;}tab1_mc.onPress = function(){ // here you can write the navigation function, ie if you want to open a html or an swf or what ever. In case u want to open an html u can use getURL, or if it is an swf then u can have a look into MovieClipLoader class.}myXML_xml.ignoreWhite = true;myXML_xml.load("/myxmlfile.xml"); again for the above example you need to have the specific xml schema ie something like <xml><tag1><linkText>Click here</linkText><linkTarget>"www.w3schools.com"</linkTarget></tag1></xml> Hope I was of some help.Thank you
  6. Hi, Please have a root movie and then an empty movie clip into which you can load all your external swf files. I suggest you to use MovieClipLoader() class. This class gives your better control on the swf loaded.Hope I am of some help.
  7. Hi Both,Even though I dont have enough experience building flash games, but I am interesed in doing so, a lot. If a newbee can join you gurus please do mail me atashwanin@techmahindra.com ashwani_nair@yahoo.comashwani.nair@gmail.com
  8. As suggested kirupa.com is a very good site to get help from.I would like to suggest a method, i dont know if you find it simple or not.you may creat an xml file to store all the questions and answers as<xml> <info> <question>3 + 2 = ?</question> <answer>5</answer> </info> <info> <question>3 + 8 = ?</question> <answer>11</answer> </info> <info> <question>8 + 2 = ?</question> <answer>10</answer> </info> <info> <question>3 + 12 = ?</question> <answer>15</answer> </info></xml> so once you have your database of question and answer ready with you. You can load the xml into your flash movie and then split it to an array. This can be done as var myXML:XML = new XML();myXML.onLoad = function(success){ if(success){ // here you need to place code which will split the information in the xml object to say some array or object array accordiing to your convinience. }else{ trace("loading Failed"); }}myXML.load("/myxmlfile.xml"); once you have done this, you can just load the question to a dynamic textfiled placed on your stage and check if the answer is correct or not.Anyway selection of which question can be done by the function displayQuestion(Math.round(Math.Random() * theArray_arr.length)); The good thing about this is, when ever you want to change the set of questions or say to increase or decrease the number of quesitons.. u just have to replace the XMLHope this is of some help.
  9. I it is possible. But you must have a mechanism in flash to reflect the change in database ( preferably XML ). The mechanism you must use will depend on the project you are workiing on. you can set interval, or enterfram or a loop or something like that or even some kind of trigger from a movieClip whose nth frame will call a funciton in root so that... the movieClip will act as a trigger.
  10. Hi,As far as my knowledge ( as I am not sure if I am correct or not ) you have placed a movie clip ( the menu) inside the movie clip mc_nav. Most probably this is happening as your funcitons ( as this.onRollover = function(){} or say this.onPress = function() ) are overridden by the same fincitonis delacred inside mc_nav.if you have written as mc_nav.onPress = function(){ this.startDrag();} then mostprobably only this funciton will override any function inside it.so try using the combination mouseListener and hittest to get the result.One more suggestion. Please follow naming conventions ie end a movie clip with myname_mc ( this will give you all the options in a drop down list associated with movie clip )text = mytext_txtmovieclip = myMovieClip_mcbutton = myButton_btn etc.Hope I am of some help to you.
  11. Hi, There are two cases, if you are loading a swf ( it is always better to load an external swf if it is for web ) then you can do as other are suggesting ( placing an empty movieclip an then loading external swf to it). And if you are planning to have movieClips in your library and loading it according to the your selection then you can at first create an empty movieclip and place it on the stage at (0,0) and give an istance name, say myEmpty_mc then u can say.myEmpty_mc.attachMovie("myMc","mynewMC_mc",myEmpty_mc.getNextHighestDepth(),{_x:10,_y:10}); in the above code, "myMC" must be the linkage name of the movie clip to be attached.the x and y position is passed as an object eg : {_x:10,_y:10}
  12. ashwani_nair

    help required

    What smiles says is a good thing. The problem I see in your codes are that it is hard coded.I prefer you to use relative path rather than coding it hard way to your "c:" driver or any specific drive.
  13. Hi, As suggested above, the best way is to use XMLs for ur data storage, and in case you are specific that you want to use a asp for this purpose, then its better to use 'loadVars()' asvar my_lv:LoadVars = new LoadVars();my_lv.onLoad = function(success:Boolean):Void { if (success) { trace(this.dayNames); // Sunday,Monday,Tuesday,... } else { trace("Error"); }}my_lv.load("http://www.myserver.com/mypage.asp"); Hope this helps you
×
×
  • Create New...