This content has been marked as final. Show 13 replies
Check this out:
thank you greg
you are a real asset to the community, thank you
Appreciate the code - but I couldn't get it to work.
I made separate component files for AboutUs, Contact, Home.
Made application file.
It give this error:
1046: Type was not found or was not a compile-time constant: AboutUs.
1046: Type was not found or was not a compile-time constant: ContactUs.
1046: Type was not found or was not a compile-time constant: Home.
Your help appreciated, because I'm about ready to kiss off Flex. Cannot for the life of me get one mxml to call another mxml. Some 'insider' should left the rest of us know. Thank-you.
Just what is the mystery?
I had the problem where they didn't work for me either. I had watched the video too and it looked so easy :-)
The problem was I wasn't pointing to the right directory. When creating an application, I think it will, by default put it in the src directory. If you clear that out and decide not to put your application there but in the root above that, you should be fine. However, if you put it in the src directory, try pointing your components file to include the src directory.
Hope that helps.
I had the same error, and cant figure out whats wrong
i made a new folder, components, then in that a folder, viewstackChildren, then in that the Home.mxml etc files.
dont kiss off flex just yes, im finding it somewhat difficult only because im new to action script, but i cant get enough of flex
If your components are in the same folder as the Main app, then maks sure you have this in the application tag:
It tells the compiler to look for your components (declared with no namespace) in the current folder.
that did the trick
In my example code, xmlns:comp="components.viewstackChildren.*" is what allows the app to "find" the components in the components/viewstackChildren folder. Of course if you move them you need to edit the code.
Yes, i made a folder, components, and a sub folder, viewstackChildren but thats when i got the error,
but thats the way it should be right, in a separate folder?
The "components" folder should be a sub-folder of the folder where ViewStackSite1.mxml resides, and then viewstackChildren should be a sub-folder of components. Then all should be well.
okay, thats the mistake i made, i had viewStackSite1 in the src folder,
thanks for the clarification
okay, set up the folders they way you mentioned and now it wont even launch,
cant figure out what i did wrong.
i havethe viewStacksite1 in the components folder and the
home, about us, contact in the viewstackChildren folder which is a sub folder of components folder
Anytime I mention sub-folders for components, data files, images, etc. in my posts they are always relative to where the main application mxml file is.
So the components folder should be a sub-folder of the folder that contains ViewStackSite1.mxml.
Having said that, you need a Flex project setup and put these test applications grabbed off the forums in the top-folder of that project, unless you know how to put the files somewhere else and get it to work.
I have a Flex project with a main mxml file Test.mxml in the project's "src" folder. This is where I create all my apps for these postings.