Flash Read Child XML From Embed Tag?
Sep 21, 2009Say I have an flash object embedded in XHTML like so.[code]...
Can I get to the "/data/something/@whatever" from within my flash app?
Say I have an flash object embedded in XHTML like so.[code]...
Can I get to the "/data/something/@whatever" from within my flash app?
So I am using this code to embed my .swf file. I am creating classes for each asset in my library.
[Embed('assets/assets.swf', symbol='game.menu.levels')]
public static const LEVELS_MENU:Class;
It works just fine but how can I access a child element multiple depths down?
[Code]...
i have main.swf with var car:String = "my car";then i addchild a new swf; child.swfinside child, how can i trace my "car" var?MovieClip(root).car give me Undefined
View 3 RepliesAs the title says, suppose I have an hypothetical XML containing this:
[Code]....
I can check if a certain speech has a bg change by simply doing this:
if(bgs[i])
{
//true!
}
what should I compare in the case of sounds, I've tried many, like:
[Code]....
I created a form dynamically by adding each component in action script,now i want to get back the text/data entered in to that each component dynamically?[code]...
View 2 RepliesI am using the following line before my class declaration .
[Embed(source="C:WINDOWSFontsVERDANA.TTF", fontName="VERDANA", mimeType="application/x-font-truetype", flashType = true)]
But there is no change in the appearance of the Text whatsoever.. I need the text to be crisp and clear.Just like the way it looks when we embed the fonts using the Embed... Button in the Flash IDE.
So I want to read http streams using flash tcp sockets. I do not really need the http header at all - all I need is body which contains flv. so how to read http response body into byte array using flash sockets?
View 1 RepliesI've been experimenting with learning game coding and have encountered an issue I'm curious about...
At the moment I have 3 GIFs and 1 sound effect being used, with more to come. Now, is it more recommended to embed these files, which I'm been doing, or is it better to load them externally? To be honest, I really hate the idea of having to load them and would much prefer to embed them directly in to my project. What is the general consensus as to which technique is better?
I've used this site as a resource leading up to this, not particularly sure if I worded this correctly I have a class "Block" which is just a square (will be something else later on in the process) I want each block to have controls to add an additional block in either direction so I have another class BlockButtons which has my buttons for each direction.
And another class GlobalVar where I keep all my variables for funsies
[Code]...
I have an Movie Clip in Flash that have subobject of button type which has subobject of input text and movie clips. Right after creation core Moveclip all subobject are set to null, when I expect them to be valid objects.
[Code]...
MC_Core_design was created in Flash and exported to Actionscript. I've done this for button_1 class aswell. The code was written using Flex. When I comment out both lines that result in error I get correct view of the core Movie clip with all subobject. How can I set subobject properties right after object creation?
I have a picture on the stage that has multiple items that have hotspots/links over them that should open a child swf on top of the background and show details about the items. then have a button in the child swf itself that removes the child from over the background so the user can click on another item etc.I found this code in someone's post and I am trying to modify it so that works for multiple swf files...it currently works for a single swf.I wan to pass the name of the button in front of the .swf in the URLRequest to have the same name as the instance name of the referring button. But I can't figure it out. Here is the code I am using on the stage
View 2 RepliesWe have a flex application which compiles fine on windows box using mxmlc ant task but when we try to run the same build scripts on linux, it throws the 'Invalid Embed directive in stylesheet' error indicating it is not able to resolve the path to the image files.
Can someone pls. educate me on if there is a difference in the way the image files are looked up, in a CSS file, on windows vs linux.
Flex sdk version is 3.3. The same sdk is used on both windows and linux. Not sure if this has been fixed by any future 3.x sdks.
Making a piano/keyboard application and trying to figure out the best way to set this up .I plan on having a directory of sounds for each 'instrument' in my assets folder (piano1/C4.mp3,piano1/D4.mpg,...)Is there a way to import/embed all of these as an array? Also is there a way I can pass a variable to this class to indicate which folder I want to import these from? Something that would be ideal
var type = "piano2"; //passed from class being called by
foreach(notes as note){
[Embed(source = 'assets/sounds/'+type +'/'+note+'.mp3')] private const C3:Class;
public var c3:Sfx = new Sfx(C3);
}
Or would it be a better idea to have a class for each of these "types" that pulls all notes?
A friend of mine has a Flash Action script running on a LAMP server that currently reads an xml config file. He's asked me if it's possible to remove the xml file, and replace it somehow with a system (lets call it an 'auto xml generator') that intercepts the request to read that file and generates an output, so it appears to all intents and purposes as if the file still exists and contains the contents that has actually been returned from our auto xml generator'
View 3 RepliesThe name of my DocumentClass is Main. So, what's the difference between :
var myClass:Main = new Main();
var mcInLibrary:MovieClip ;
/////////////////////////////////////////[code]............
I'm trying to call a function in one child class (Circle.as) from another child class (Wedge.as). Circle.as is instantiated by the document class (Tree.as), and Wedge.as is instantiated by Circle.as. How do I do this? This is my code:
Tree.as
package com.treediagram
{
public class Tree extends MovieClip
{
[code]....
How to call a function in a Class from another Class?but it was a bit hard to follow as it relates to my problem. One of the solutions worked, but was commented as being bad form, and another did not work, so I want to make sure I structure my code properly.
I'm creating a wrapper SWF that needs to embed multiple swf's using the [Embed ] tag in Actionscript 3.How can i embed a custom swf when compiling a as3 project using the flex sdk, E.G:
[Embed(source="/MySWF1.swf", mimeType="application/octet-stream")]
However i want to specify the 'source' location at compile time.How can i do this?
how to read the xml in flash in AS2.
[Code]...
I write a simple xml code, and I try to read the xml file into flash, but I got "undefined" in my output.The codes are as following. Do you know how to sove the problem?[code]...
View 1 RepliesI am new to Flash and I have a TextArea I would like to make read-only so the user can not copy and paste the text. Is this possible?
Examples or links welcome I dont mind learning ;)
I have this XML that I need to read into flash. I want to display one of the temperatures in the xml. For instance, say I want to display the temperature for 'Sydney'... how would one go about doing that?
Here's the XML:
<CurrentTemps>
<City Name="Gosford" Temp="23.9" />
<City Name="Sydney" Temp="25.4" />
<City Name="Brisbane" Temp="23.4" />
<City Name="Adelaide" Temp="24.7" />
<City Name="Perth" Temp="21.3" />
<City Name="Melbourne" Temp="22.1" />
</CurrentTemps>
I'm looking for a simple, fast way to display just the temp that I desire, and not all of them.
I have a problem with reading the IP address of a computer through Flash. I know the easy way - by using a php script, but this can't help me for this reason - I've created an embeddable flash component, which is a voting poll. The php files and the flash movie are stored on my server, and an embed code is offered to place the component on other sites. So, I'm using loadVars to call a php file from the server and read the IP of the computer that's voting. The problem is, I think, that the php files are stored on my server, and they read its IP.
View 2 RepliesThis is because I use movie clips within other movie clips.
I wondered if anyone knew a workaround or trick that I could use to get text into google. I have a couple ideas but they're just ideas.
I would like to create an alternate page that is not flash, but a regular html page with all of the text I want google to read inside it. Somehow I use code to tell it that when a user clicks on the link, to redirect them to the flash webpage, but when a search engine sees it, to send the search engine/google to that regular html page, where it will gather all of the text and then that text will show up on google's page when you do a search and my site on google? Even if this was possible, would google frown upon this and ban me or something?
The other idea I have is to use invisible text at the bottom of my page. This will be regular html text that is the same color as my background. But I heard this can get you banned from search engines like google if you are using lots of keywords, but I wouldn't be using keywords. I'd be using the few sentences of content that their stupid crappy technology doesn't read, forcing me to bust my hump trying to find a workaround for. It sucks that google doesn't even use keywords in my metadata for rankings either. So I can't even use that with them.
This is because I use movie clips within other movie clips.I would like to create an alternate page that is not flash, but a regular html page with all of the text I want google to read inside it. Somehow I use code to tell it that when a user clicks on the link, to redirect them to the flash webpage, but when a search engine sees it, to send the search engine/google to that regular html page, where it will gather all of the text and then that text will show up on google's page when you do a search and my site on google? Even if this was possible, would google frown upon this and ban me or something?
The other idea I have is to use invisible text at the bottom of my page. This will be regular html text that is the same color as my background. But I heard this can get you banned from search engines like google if you are using lots of keywords, but I wouldn't be using keywords. I'd be using the few sentences of content that their stupid crappy technology doesn't read, forcing me to bust my hump trying to find a workaround for. It sucks that google doesn't even use keywords in my metadata for rankings either. So I can't even use that with them.
i have problem with swfLoader in flex, when i close following code in click method i can easly add many swf to main application
<mx:VBox id="content" width="100%" height="100%" ></mx:VBox>
public function doIT():void
{[code]....
when i close adding those swfs in loop i have the same error, it looks like child apps couldn't access certain objects that were instantiated by another child app, so what can i do?
I have a movieClip with one frame on the timeline containing one child whose instance name is "myContent"I am using this function to swap "myContent" with any number of possible class instances.
Code:
function setContentAsClass(c:Class)
{
[code].....
var viewStack:ViewStack = new ViewStack();
viewStack.percentWidth = 100;
viewStack.percentHeight = 100;
[Code]....
Its only displaying canVas3 contents not canVas1 and canVas2
I have a component mxml file in which i have a view stack, on click of a button i navigate to the first child, now i need to navigate to the second child during onclick of a button present in the second child. All the childs are component files included within the view stack. How could this be done, Sample code is present below,
[code]...
Now in my offering.mxml file if i try to access navigationViewStack i am getting an error stating 'Access of undefined property navigationViewStack.
I've seen some discussion on how to load a child swf using swfLoader and accessing it's variables but I am wondering if it is possible to do this without adding any code to the child swf.Either accessing public vars or listening for funciton calls would work fine
View 2 Repliesi'm new to AS3 and i was wondering what is the best way to remove a child at a point. i tried Holder.removeChild(Holder.getObjectsUnderPoint(new Point(exampleX, exampleY))[0]); however that returned ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
View 2 Replies